- install openssh on client and server
- create ssh key using:
ssh-keygen -t dsa
- Log into server using sftp
- copy the file
id_dsa.pub (generated in the client) to the server - on the server, merge contents of (client) id_dsa.pub with ~/.ssh/authorized_keys2
- From client, try logging in using ssh or sftp. Key should be accepted.
An additional step to consider is to generate config file to make shortcuts for the ssh command. Suppose you want to access the following server
ReplyDeletewww.example.com
which allows ssh connections in the port 1000 for a user "testuser". Assuming that the steps in the post have been executed, simply create the file "config" in the directory .ssh with the following contents:
Host example
HostName www.example.com
User testuser
Port 1000
Now, by typing in the console
ssh example
You will be directly connected to the ssh server without any password prompting (if you have set up the steps mentioned above in the post)
Thanks for that Miquel, I didn't know that latter trick.
ReplyDelete