non-interactive ssh sudo... prompts for the password in plain text

Posted by Iain on Super User See other posts from Super User or by Iain
Published on 2011-03-13T12:06:55Z Indexed on 2012/11/30 5:11 UTC
Read the original article Hit count: 149

Filed under:
|
|
|

I'm running some non-interactive ssh commands. The ssh authentication is taken care of fine through the ssh agent, but if I run a command that requires sudo then the password prompt in my terminal is plain text. For example:

ssh remotemachine "sudo -u www mkdir -p /path/to/new/folder"

will prompt me for the password in plain text. Does anyone know how I can get it to use the normal secure prompt or that I can pass the password via a switch? (as then I can set up a secure prompt on this side before I send the command)

Any help is much appreciated.

© Super User or respective owner

Related posts about osx

Related posts about security