AW: how to give password for ssh connection from shell script

Alessandro Simula alessandro.simula at urmetcns.it
Mon May 8 07:44:51 UTC 2006


Try this: (save it on a file and exec it)

cat > myssh.sh <<EOF
#1 Here you put clear text password. Beware!
echo '!#/bin/bash'   > /tmp/pswd.sh
echo "echo XXXXX" > /tmp/pswd.sh
chmod +x /tmp/pswd.sh

#2) export your varibles
export DISPLAY=:0
export SSH_ASKPASS=/tmp/pswd.sh

#3) Finally...
setsid ssh user at host
EOF

Then:
 . myssh.sh

Alex



On Wed, 2006-05-03 at 13:50 +0200, joe at illegal-access.de wrote:
> Hi Krishnaprasad,
> 
> I had the same problem some time ago... but I got NO solution... BUT the "authorized_keys" are just therefor... so you should use them (if possible ;-)
> 
> cu,
>  Joe
> 
> 
> 
> >Hi all
> >
> >          how can i give password for a ssh connection from shell 
> >script. I dont want to disable the ssh password through "ssh-keygen"  
> >and "authorized_keys" . i tried by echoing password from terminal as 
> >well as from script. But still it is prompting for the password.
> >
> >Is it possbile ...?
> >
> >Thanks
> >Krishnaprasad
> 
-- 
Alessandro Simula <alessandro.simula at urmetcns.it>




More information about the redhat-list mailing list