SSH Keying Through Terminal (Mac OS X / Linux) Print

  • 280

For Mac OS X and Linux

  1. In Terminal, type
    ssh-keygen -t dsa
  2. Accept the defaults when it queries you.
  3. Enter the following command, replacing 'username' with your username, and 'ip.add.ress.here' with your server's IP address.
    rsync -av -e "ssh" ~/.ssh/id_dsa.pub
    username@ip.add.ress.here:.ssh/authorized_keys
  4. Enter your root password.
  5. Now you will need to SSH into your server to confirm the key was uploaded.
    ssh username@yourdomain.com
  6. Enter the following commands:
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
    chown username. ~/.ssh/authorized_keys




Was this answer helpful?

« Back