ssh directory and the authorized_keys file the first time.

  • Create the .ssh directory: mkdir ~/.ssh.
  • Set the right permissions: chmod 700 ~/.ssh.
  • Create the authorized_keys file: touch ~/.ssh/authorized_keys.
  • Set the right permissions: chmod 600 ~/.ssh/authorized_keys.

cat <your_public_key_file> >> ~/.ssh/authorized_keys