Install & Configure OpenSSH on Ubuntu

Install and Enable OpenSSH Server on Ubuntu Linux

Open Terminal and enter the following commands:

Stop, Start and Restart OpenSSH service, Status and Reload

Open Config File and Change SSH Server Port Number

Change port 22 to different port number.

Optionally, For improved security:

  1. Find and change PermitRootLogin from yes to no
  2. At the end of the config file, add the following lines:
    UseDNS no
    AllowUsers [username]

    After reload, only above users can connect to the SSH server
  3. Save, close and reload SSH service

How to use SSH to connect to a remote server

And enter password. To quit from the connected session:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.