Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Simon Sheehan, 8088, Daniel Beck Nov 30 '12 at 22:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

Turns out it's quite simple:

ssh core -t "sudo ssh app-01"

More info here: http://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"
share|improve this answer

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