DONDON Develops

How to set up an SSH connection between machines

Last updated on

A quick walkthrough detailing how to link two machines via SSH


  1. generate an ssh key from the work station machine: ssh-keygen -f ~/.ssh/<your-key-name>
  2. copy the new key from the work station machine to the agent machine: ssh-copy-id -i ~/.ssh/<your-key-name> <ip addr of agent machine>
    1. example: ssh-copy-id -i ~/.ssh/home-lab-key 192.168.0.10
  3. make sure ssh-agent is running on workstation machine: eval $(ssh-agent -s)
  4. add ssh key to registry for use: ssh-add ~/.ssh/<your-key-name>
    1. example: ssh-add ~/.ssh/home-lab-key
  5. you should now be able to run: ssh <ip addr of agent machine> and connect to that machine
    1. example: ssh 192.168.0.10