Tag Archives: Change SSH Port

Install and configure SSH server for Ubuntu 16.04

  • Intall SSH Server:

$ sudo apt install openssh-server

  • Change SSH Port, if needed:

$ cd /etc/ssh/

$ sudo nano sshd_config

The change port number, save and exit.

  • Restart SSH service:

$ sudo systemctl restart ssh

  • Open SSH session to control another machine:

$ ssh hostname@host_ip_address -p ssh_port

  • Temporary let ssh session (that is controlling a remote host) run under background (i.e. a special command to suspend the SSH client):

Press “–” (Shift -),  “Enter", then “~", followed by “Ctrl-Z"

  • Re-enter interactive mode after Ctrl-Z (i.e. back to the process that is let running in background after press Ctrl-Z):

Type “fg” and hit “enter” in terminal.