On Sun, 02 Nov 2003, Aaron Walker <ka0ttic@DELETE_THIScfl.rr.com> wrote:
> I am trying to find out how to setup ssh so that I can log into another
> computer without using a password (so I can use it in a script). Does
> anyone know how to go about doing this? I created a new user just for
> this purpose, and deleted the password field in /etc/passwd. When
> logging in with that user on the console, it doesnt ask for a password,
> but if I try connecting via ssh it still asks for a password.
Doesn't your system use shadow passwords? Whatever you did, you should
undo it, remove that user, or set a password by normal means.
To ssh and run a particular command without password or passphrase,
generate a key without a passphrase and transfer the resulting .pub key to
the ~/.ssh dir of the destination user. Then from that directory append
that to the authorized_keys file (cat whatever.pub >> authorized_keys).
Make sure that the .ssh dir and files on destination are owned by that
user there. And it may be a good idea to do: chmod -R go-rwx ~/.ssh
Then in 'man sshd' read AUTHORIZED_KEYS FILE FORMAT to see how to set a
command for that key.
Note that unless it is an old system, many default to ssh2, so you should
probably generate a dsa key with ssh-keygen.
--
David Efflandt - All spam ignored
http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/