Setting up passwordless ssh is fairly straight forward and plenty of documentation on it can be found.
Firstly you need to need to generate a key on your local machine:
ssh-keygen -t dsa
You most likely want to accept the default location when asked, i.e. $HOME/.ssh/id_dsa
For a passphrase it is recommended to choose something other than the ssh login password.
Two files will have been generated, id_dsa and id_dsa.pub. You want to copy the second of these, or at least it contents to the remote machine.
e.g. scp $HOME/.ssh/id_dsa.pub <login>@<remote>:.
On the remote machine open $HOME/.ssh/authorised_keys (create it if it doesn't exist) and add the contents of the id_dsa.pub from your local machine.
e.g. cat id_dsa.pub >> $HOME/.ssh/authorized_keys
Now you should be able to ssh and scp to the remote machine without supplying the login password. You will instead be asked for your passphrase but once you enter it your OS should provide you with the option of remembering it and you shouldn't have to enter it again.
No comments:
Post a Comment