How to set up an SSH connection between machines
Last updated on
A quick walkthrough detailing how to link two machines via SSH
- generate an ssh key from the work station machine:
ssh-keygen -f ~/.ssh/<your-key-name>
- 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>
- example:
ssh-copy-id -i ~/.ssh/home-lab-key 192.168.0.10
- example:
- make sure ssh-agent is running on workstation machine:
eval $(ssh-agent -s)
- add ssh key to registry for use:
ssh-add ~/.ssh/<your-key-name>
- example:
ssh-add ~/.ssh/home-lab-key
- example:
- you should now be able to run:
ssh <ip addr of agent machine>
and connect to that machine- example:
ssh 192.168.0.10
- example: