Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 661 Bytes

ssh-keys.md

File metadata and controls

29 lines (26 loc) · 661 Bytes

Create SSH key locally and install in remote machine

  1. On client, navigate to the ssh folder.
    cd ~/.ssh
    
  2. Generate a key pair, public and private. Make sure to specify a unique name to allow ids for connecting to multiple devices.
    ssh-keygen
    
  3. Add the key to the ssh agent, so it is used when attempting to connect.
    ssh-add ~/.ssh/key-file-name
    
  4. Copy to the target server.
    ssh-copy-id username@remote-host
    
  5. Verify by trying to connect to the remote host.
    ssh user@remote-host -i ~/.ssh/key-file-name
    

Reference

# List keys known by ssh-agent
ssh-add -l