Networking Knowledge Base
SSH Port Forwarding
Host Machine
- Make sure SSH server (
openssh-server
) has been installed and is running on host machine.
- Get the host machine's private IP address.
- Get the host machine's public IP address.
- Configure router to forward
ssh
requests to port 22 on host machine's private IP address.
Client Machine
- Configure client machine for passwordless login:
- Add entry for host machine to
~/.ssh/config
file (public IP address of host machine, user name).
- Check for existing ssh key (
ls -al ~/.ssh/id_*.pub
) and create one if none exists (ssh-keygen -t rsa -b 4096
).
- Copy public key over (
ssh-copy-id remote_username@server_ip_address
).
NULL