How to Enable SSH on Ubuntu 18.04?

Step 1: Open terminal from Ubuntu dash or by keyboard shortcut CTRL+ATL+T

Step 2: Check if SSH is already installed or not using command

# ssh local host

(If it shows “connect to host localhost port 22: connection refused” you can continue the process)

Step 3: Update the package repository using command

# sudo apt-get update

Step 4: Install OpenSSH software using command

# sudo apt-get install openssh-server

(Password is required to install process since we are using sudo command)

Step5: To verify the installation was successful and to check SHH is running or not, use command

# sudo service ssh status

If “Active: active (running)” is displayed it means SSH is installed and working in work machine.

Log into Remote Server with SSH

Step 1: Open the terminal and type following command

# ssh username@IP – p222

(Replace username and IP with your username and IP)

SSH Configuration to change SSH port number

Step 1: Use Gedit or nano text editor to edit SSH config file using command

# sudo gedit /etc/ssh/sshd_config

Or

# sudo nano /etc/ssh/sshd_config

Step 2: By Default SSH Port number is 22, you can change the port number by replace 22 with desired port number

Step 3: For the changes to take into effect, restart SSH with the following command:

# sudo systemctl restart sshd.service

Configure Firewall

The default firewall configurations tool in Ubuntu is UFW, configure it with the command:

# sudo ufw allow from any to any port xxxx proto tcp

(Replace xxxx with your port number).

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to add IP Address to servers

1.Login to the server via RDP. 2.In the Run window type NCPA.CPL. 3.In the network properties...

How to configure IP's on Ubuntu 18?

To configure a static IP address on your Ubuntu 18.04 server you need to modify a relevant...

How to install Wordpress in webmin

  The following steps are followed for installing Wordpress in Webmin   Open File Manager in...

How to install Webmin in CentOs

  Installing webmin using YUM repository Create a .repo file using a command # nano...

How to install Virtualmin in webmin

  Steps for Installing Virtualmin on Webmin (Ubuntu):   Setting the hostname and FQDN For...