Results 1 to 5 of 5
Hi all,
I want to ssh a box say:
Code:
$ ssh -l a12345 boxname
but, it is asking me to enter a password. I don't want to enter the ...
- 08-15-2007 #1
how to ssh on a box without manually giving password at runtime
Hi all,
I want to ssh a box say:
but, it is asking me to enter a password. I don't want to enter the password at runtime...means it should take the password automatically if somehow we provide it at the command prompt.... I thought using:Code:$ ssh -l a12345 boxname
but still ssh command is asking me to enter the password though i have provided it at the command prompt using echo command.Code:$ echo "mypassword"|ssh -l a12345 boxname
Is there any way to achieve this.
Thanks-
- 08-15-2007 #2
You can use a key file instead of a password. From the man pages:
You will need ssh server that is set up to accept authentication through key pairsCode:-i identity_file Selects a file from which the identity (private key) for RSA or DSA authentication is read. The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. Identity files may also be specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration files).
- 08-15-2007 #3
Using ssh-keygen...and creating all necessary files and running the ssh-agent, Im able to run any command on target box/host without entering the password at command prompt or specifying it at the command prompt.
But,
NOTE: It would be appreciated if we don't go for creating the .pub and authorized_keys files on target host. Means, I just want to give the password at command prompt while calling ssh -l ..userid.. boxname... and that too in encrypted form...not visible to any other user if he runs history command and later do some crazy things using my userid/password.
"gpg" command can be used for this...but i have never used it before.
Thanks-
- 08-15-2007 #4
A possible solution
- 08-19-2007 #5
ssh [Remote address] "echo $(cat /root/.ssh/id_dsa.pub) >/root/.ssh/authorized_keys"
It will ask for your password like normal...after you put it in, try sshing in..you should not need a password again..Last edited by aliosa27; 08-19-2007 at 06:20 AM. Reason: forgot a line


Reply With Quote