SSH: Using the public key

  • Once you've copied the public key to the remote machine you need to put it in the .ssh/authorized_keys file (creating it if necessary) for each user you want to be able to connect as.

  • You need make sure the .ssh directory exists and is only accessible to the user by using the command mkdir ~/.ssh >> chmod 0700 ~/.ssh, while logged in as the user in question.

  • then you can use the command cat ~/id_dsa.pub >> ~/.ssh/authorized_keys (replacing ~/id_dsa.pub with the path to the file you copied which contains public key), as the user in question.