ssh

View fingerprint of server ssh key
ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub

View fingerprint of server key in known_hosts
ssh-keygen -l -F [hostname or IP address]

Remove server key from known_hosts
ssh-keygen -R [hostname or IP address]

Generate keypair (not sure why, but I prefer dsa – old habit, I guess)
ssh-keygen -t dsa
ssh-keygen -t rsa

Copy pub key to a server
ssh-copy-id username@server

  • Benjie
    #1 written by Benjie  1 year ago

    Generate a key:
    ssh-keygen -t rsa

    Get passwordless access to a remote server using said key:
    ssh user@server “cat >> ~/.ssh/authorized_keys2″ < ~/.ssh/id_rsa.pub

    • AltJ
      #2 written by AltJ  1 year ago

      Thanks Benjie
      I’ll add them, I think I prefer to move my pub keys over with ssh-copy-id

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong>

Go to Top