Wednesday, March 18, 2015

The solutions for communicating on SSH Commend

@ If you faced the following error, the solution would help you

@ Error 1
>Pseudo-terminal will not be allocated because stdin is not a terminal.
@ the solution 1
@ [-oStrictHostKeyChecking=no] Option make a fingerprint to write in a known_hosts
@ (maybe -T -oStrictHostKeyChecking=no)
$ ssh -oStrictHostKeyChecking=no user@somehost sudo /home/tomcat/sh/sample.sh

@ Error 2
>sudo: sorry, you must have a tty to run sudo
@ the solution 1
ssh -t -oStrictHostKeyChecking=no user@somehost sudo /home/tomcat/sh/sample.sh
or
@ Comment the requiretty in /etc/sudoers like the following
#Defaults requiretty 

@ Extra explanation.
@ -T Disable pseudo-tty allocation.
@ -t Force pseudo-tty allocation.

http://aero.sarang.net/blog/2009/01/ssh-1.html

No comments:

Post a Comment