How do you setup server to server SFTP to use public-key authentication instead of user account and password?
+4
A:
on client you need to generate its public key and add it to server's authorized key list.
ssh-keygen -t dsa -f id_dsa //on client machine
mv id_dsa* ~/.ssh/ //on client machine
scp ~/.ssh/id_dsa.pub USER_NAME@SERVER:~/.ssh/HOST_NAME.key // on client machine
cat ~/.ssh/HOST_NAME.key >> ~/.ssh/authorized_keys2 // on server
bhups
2010-02-09 18:56:06
Use `ssh-copy-id` instead of your `scp` + `cat` dance.
ephemient
2010-02-09 20:25:14
Nice, like that ssh-copy-id. I'm on a HP-UX and wish it were installed.
happyappa
2010-02-09 20:40:47
Oh right... I forget that not all the world uses OpenSSH. Sad.
ephemient
2010-02-10 22:05:37