Enable SSH access to Ubuntu 16.04

If it isn’t already installed, install OpenSSH using the following code in Terminal:

 sudo apt install openssh-server 

Check that OpenSSH is running correctly using:

 sudo service ssh status 

The SSH port used can be edited by editing the configuration file in nano using the following code:

 sudo nano /etc/ssh/sshd_config 

To change the port, edit the line Port 22 to whichever port is preferred. Apply the changes using the following code in Terminal:

 sudo service ssh restart 

You should now be able to log in using SSH from another machine. Replacing PORT with the correct port number, USERNAME with the correct username, and HOSTNAME with the correct hostname, use the following code:

 ssh -p PORT USERNAME@HOSTNAME 

Source:
http://ubuntuhandbook.org/index.php/2016/04/enable-ssh-ubuntu-16-04-lts/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s