on 05-13-2008 4:15 PM
Hi
I wanna know how to give password to a ssh command in a script... that is my command iniside script is
q=`ssh 172.16.1.2 /usr/sbin/alternatives --config java </root/Desktop/2.txt 2>&1 | grep jdk1.6.0_05`
when i execute the script file and when this commands get executed it prompts for passord.. i dont want the script to wait for password from the terminal
i have also obtained the password as follows
#! /bin/sh
read ip
echo $ip
oldmodes=`stty -g`
stty -echo
read password
stty $oldmodes
i want to give this password which i obtained to the command so that it doesnt wait for a password at a terminal
I suggest you use ssh-keys without a password for this purpose:
http://www.linuxhelp.net/guides/ssh/
--> no need for a password.
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.