LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH and how to stop password being shown in clear text (http://www.linuxquestions.org/questions/linux-newbie-8/ssh-and-how-to-stop-password-being-shown-in-clear-text-854616/)

uncle-c 01-06-2011 08:42 AM

SSH and how to stop password being shown in clear text
 
Greetings,
I have a headless server running Centos and I often login in remotely to administer it. I have passwordless login and sometimes run commands remotely via ssh from a client machine. I've tried to shut the server remotely but have come across a small problem. Here is the output of the command I use to shutdown :

Code:


unclec@linux-desktop $ ssh centos 'sudo /sbin/shutdown -h now '
PASSWORD : 123ABC

As passwordless login is set up I do not need to enter a password to ssh BUT as I am running sudo on the server I am asked to enter my centos unclec password and this is shown in clear text on my local machine terminal. Is there a way to prevent this or should I edit the sudoers file on centos so it does not ask me to enter the password when "sudoing" ?

Cheers,
UC

AlucardZero 01-06-2011 08:59 AM

Force psuedo-tty allocation with ssh's "-t" option
Code:

ssh -t centos 'sudo /sbin/shutdown -h now '


All times are GMT -5. The time now is 03:16 AM.