Hi gurus,

I wanna login to my server with ssh command in bash shell.
I found a script that login to a server with ftp command in bash shell.

The following is the snippet of a ftp shell..
---------------------------
ftp -n $Server <<End-Of-Session

user anonymous "$Password"
binary
bell                # Ring 'bell' after each file transfer
cd $Directory
put "$Filename.lsm"
put "$Filename.tar.gz"
bye
End-Of-Session

---------------------------------- 

so I made a simple script(simple.sh) below.
(abcdefg is the password of my_user)
----------------------------------
#!/bin/sh

ssh [EMAIL PROTECTED] <<END
abcdefg
echo "It works !!" > does_this_script_work.txt
exit
END

exit 0
---------------------------------

The result was....
-----------------------------
$ ./simple.sh
Pseudo-terminal will not be allocated because stdin is not a terminal.
[EMAIL PROTECTED]'s password:
-----------------------------
Asking me the password ...

Why doesn't it work ?

I know It's not secure cuz the password is in the script, but I really
wanna make it work.

Please give me any hints.

Thanks in advance.

wolfgang.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to