Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have several boxen running Debian Wheezy. They appear to have the highly annoying problem that pressing ctrl+c in a shell that has been su:d to root will kill su, not whatever is running in the root shell. This makes working with e.g. ping or tcpdump near impossible. As I understand it, the issue is debated at length in Debian bug #628843 but there seems to be no consensus.

[20:38] alias
zsu='su root -p -c $SHELL'
[20:38] zsu
Password:
zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]? y
[20:38] <- I simply pressed ctrl+c
Session terminated, terminating shell...
[20:38]  ...killed.

I need to find a fix for this. Can I execute su differently or is there a replacement I can use instead? (Preferably no sudo and I would prefer not to allow ssh root login.)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I ran into the same thing as I had a similar shell alias. I found in the manpage a "-s" option that seemed to resolve this for me:

   -s, --shell SHELL
       The shell that will be invoked.

ie:

zsu='su root -p -s $SHELL'
share|improve this answer
    
Much appreciated! –  Bittrance Mar 12 at 22:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.