Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Turns out it's quite simple:

ssh core -t "sudo ssh app-01"

More info here:

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 .