SSH Settings
Ubuntu Settings
Add the following settings to your ~/.ssh/config
file to simplify SSH connections:
Directly type ssh myserver
to connect to the server instead of using the full command.
Remote Port Forwarding
Forward a port from a remote server to your local machine. When you connect to <remote-port>
on the remote server, it will forward the connection to <local-port>
on your local machine.
Flags
-N
: Do not execute a remote command.-f
: Run in the background.-R
: Specifies that the given port on the remote host is to be forwarded to the local machine.- Redirect the message to a file:
-v
: Basic debugging output.-vv
: Medium debugging output.-vvv
: Detailed debugging output.
Turn Off Remote Port Forwarding
Find the process ID (PID) of the SSH connection and kill it:
Then, use the kill
command with the PID: