sudo + ssh..

Mridul Pentapalli MridulP at
Tue Apr 8 02:46:12 EDT 2003

Thanks for the response. I did wonder about the order in which the commands
are called.

The tricky thing however is that the password is being asked not for root,
but for the user blah.

ntms at's password:
and not
root at's password:

I will try with adding an empty passphrase for root, but I doubt whether
this is the way to go. 


-----Original Message-----
From: donald.ritchey at
[mailto:donald.ritchey at]
Sent: Monday, April 07, 2003 6:56 PM
To: Mridul Pentapalli
Subject: RE: sudo + ssh..

You need to configure ssh for root on your machine not to need a passphrase.

Look at the ordering of events for your desired action.

1.  sudo (to root, since you didn't specify a user).

2.  ssh -l blah <remote-machine> (this is where you need to set up a
no-passphrase link)

3.  sudo to root to run 'netstat -p'

Set up ssh so that a connection to does not require a passphrase for
root and
things should work as you want.

Donald L. (Don) Ritchey
E-mail:  Donald.Ritchey at

-----Original Message-----
From: Mridul Pentapalli [mailto:MridulP at]
Sent: Monday, April 07, 2003 6:52 AM
To: sudo-users at
Subject: sudo + ssh..


I sent a mail to but no reply. I'm hoping that you guys
have a pointer towards the solution... so here goes...

My program is run by another program using sudo. I need to use netstat on a
remote machine. The command ends up looking like this

sudo ssh -l blah sudo netstat -p

This asks me for the password of blah at 

I have configured the remote machine in such a way that I can connect to it
with an empty passphrase. 

ssh -l blah sudo netstat -p 

works without asking me for any password.

Is there a way I can get the ssh to use the passphrase. Since this system
call is being invoked from within a program, I do not want to pass the
password every time.


"Code softly and carry a big debugger."

sudo-users mailing list <sudo-users at>
For list information, options, or to unsubscribe, visit:

This e-mail and any of its attachments may contain Exelon Corporation
proprietary information, which is privileged, confidential, or subject 
to copyright belonging to the Exelon Corporation family of Companies. 
This e-mail is intended solely for the use of the individual or entity 
to which it is addressed.  If you are not the intended recipient of this 
e-mail, you are hereby notified that any dissemination, distribution, 
copying, or action taken in relation to the contents of and attachments 
to this e-mail is strictly prohibited and may be unlawful.  If you have 
received this e-mail in error, please notify the sender immediately and 
permanently delete the original and any copy of this e-mail and any 
printout. Thank You.

More information about the sudo-users mailing list