πŸ”SSH Commands

Connect to a host using SSH

# Basic Connection
ssh <username>@<host ip> -p <port number>

# If no matching host key type found error is given
ssh -p <port> <username>@<host ip> -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa

# Using a keyfile
ssh -p <port> -i <keyfile> <username>@<host ip>

SSH Tunneling

Local Port Forwarding or Local Tunneling

# Machine which has blocked port 3389
ssh -L 8181:<ssh server ip>:3389 <username>@<ssh server ip>

Dynamic Port Forwarding or Dynamic Tunneling

Reverse Port Forwarding or Reverse Tunneling

Last updated

Was this helpful?