{ 9 comments… read them below or add one }

1 Sriram September 7, 2006 at 5:35 am

When I try to Authenticate via SSH using a Script , I get

The script is the same :

Pseudo-terminal will not be allocated because stdin
is not a terminal.

I tried using -t and -T switch both on and off.

Suggest if you have any better Ideas

Many Thanks
Sriram

Reply

2 Anonymous June 16, 2011 at 10:32 am

You can try replacing ” ssh $USR@$host w > $OUT” with ” ssh -t -t -l $USR $host w > $OUT”

Reply

3 krishna kumar March 28, 2007 at 6:20 am

i want to know whether i can login to a sever using SSH by hardcoding the user name and password in my unix script.

expecting your replay soon.

Reply

4 Nilesh August 21, 2007 at 12:02 pm

Yes, you can login to server using SSH by hardcoding
. For this you have to use php.
Php provides expect module to ssh login.

Reply

5 ccb March 28, 2009 at 1:40 am

@ krishna kumar
@ Nilesh

PHP isn’t necessary — you can generate public/private keys per user/host you wish to connect to and avoid passwords altogether, allowing you to fully automate your ssh connections.

Google ‘ssh without password’ and you’ll find plenty of tutorials on this process.

Reply

6 mike May 4, 2012 at 4:53 am

I found it necessary to put my commands in double quotes.

ssh $USR@$host “w > “$OUT

Not sure why that wasn’t needed for the above.

Also, do I need to include an “exit” command? Or is the channel closed automatically somehow?

Mike

Reply

7 Prateek May 9, 2012 at 6:39 pm

I want to know by Ssh command by logging to another server I am trying to run a program that contains a special character “$” and it’s giving error ….. Any advice for this

Reply

8 prathamesh October 12, 2012 at 5:35 pm

Hey I want to setup my centos machine like whenever any local user connect my pc through ssh the entry is added in any file so can see who used my machine.

So how can i seup this???

Reply

9 vinisha November 13, 2013 at 11:55 am

Hi,

i want to use ssh for file transfer. along with ssh command i want to use set of aommands in same session.
e.g. ssh HOSTNAME command

following command to be executed in one go
cd dir
ssh_get *
exit

is there any way I can do this?

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , ,

Previous Faq:

Next Faq: