• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Notes to Self

  • Aviation Weather from NOAA Plugin
    • KZZV
    • Bad Shortcode
    • Simple Metar
  • Meetings
  • Meetings Map

Mark Chouinard / April 28, 2013

SSH Public Key Authentication

rsync -av -e "ssh -p 2222" ~/.ssh/id_dsa.pub root@hostname:.ssh/authorized_keys

This adds the public key to the authorized_keys file in your ~/.ssh directory on the remote machine. You can specify a port other than 22 with -p####.

You can also copy the ssh key to the clipboard and manually add to authorized_keys on the remote machine while logged via SSH:

pbcopy < ~/.ssh/id_dsa.pub

Copy and paste from Linux:

cat ~/.ssh/id_dsa.pub

and in ~/.ssh/config locally:

#Devbox
  Host ShortName
  HostName targetDomain.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_dsa
  User mark

Filed Under: Networking Tagged With: ssh

Primary Sidebar

Footer

Copyright © 2021 · machouinard · Log in