Possible Duplicate:
non-interactive ssh sudo… prompts for the password in plain text

Here's the current workflow I have (already have some settings in my .ssh/config):

scribu@localhost$ ssh core
scribu@core$ sudo ssh app-01
[sudo] password for scribu:

Is there any way I could shorten that to a single command, similar to this?

scribu@localhost$ ssh app-01
[sudo] password for scribu:

I tried the ProxyCommand method, suggested here:

Host app-01
    ProxyCommand ssh core "sudo /bin/nc -w1 %h"

but it doesn't work because it won't let me input the password for sudo.


Turns out it's quite simple:

ssh core -t "sudo ssh app-01"

More info here: https://unix.stackexchange.com/a/48530/4584

And if you want to give a more descriptive text for the sudo prompt, you can do:

ssh core -t "sudo -p '[sudo] password for %u@%h: ' ssh db-slave-01"

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