SSH connection to remote machine...
Hi All,
I have a question on SSH... If we do an ssh connection to a remote linux machine, it will ask for a password. Once password is entered, we will be able to login... Ex: ssh root@<IP_Addr> password: So, what iam looking for is, i should be able to pass the password from the script or a single command. The user should not be asked for password. I tried the following options....but it din't work. - echo <passwd> | ssh root@<IP Addr> - ssh root@<IP Addr> --stdin <passwd> Kindly help me on this... Note: I know about sharing the keys and avoid asking password itself. |
You can use authentication based on a key pair. Edit the sshd config and set the password authentication to no (as shown below).
Code:
# To disable tunneled clear text passwords, change to no here! Code:
wim@btd-techweb01:~$ ssh-keygen -t rsa If you omit the passphrase, the user will not be prompted for the passphrase. Some other advise:
|
ssh won't read a password from a piped stdin.
If you're really dedicated to not using a key pair, consider writing an expect script to do what you want. ssh-agent may also be a viable answer. |
Thanks Wim & Complich...
But tell me, does this Key pair work for Solaris also ? .i.e from local Linux box, i have to execute commands of remote Sun box. |
Quote:
If you're trying to execute remote commands without going to a full shell, then you can specify the command you're trying to execute on the ssh command line -- eg: Code:
ssh you@yourhost commandtoexecute |
Thanks much....Looks like i can get some more ideas frm you people..
Here is what iam doing & expecting ur help on this... See, i am doing an GUI appln in Linux using QT. We have a product which works on all the unix flavours(..Lin, Sun, Mac, HPux...) The GUI application which am doing is bascically a testing tool which helps in testing this product. So far what i have made is a standalone application i.e. it works only on a single Linux box. Now am working on extending this application for testing products on remote machines(Lin, Solaris, MAC) also. So this is the actual requirement! Few of the features of this appln are like viewing the log files, filtering the contents, viewing system properties, stop/start of product services...and some more. ------------------------------------------------- So am assuming that, what all commands i have used to run on local machine, i can use the same commands for remote Linux machines also using - "ssh you@yourhost commandtoexecute" right? (with appropriate commands for Solaris, mac...) I would definitely ask many questions as i progress on this.. Thanks very much in advance... |
All times are GMT -5. The time now is 04:46 AM. |