Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Enable SSH on Ubuntu 20.04 - DesignLinux

Jun 04 2020
designlinux 0 Comments
How to Enable SSH on Ubuntu 20.04

SSH (Secure Shell) is an encrypted protocol which allows connections between client system and a servers. You can connect to your system remotely, perform administrative tasks and access files. Also, you can transfer files securely via scp and sftp. In this tutorial we will show you how to enable SSH on an Ubuntu 20.04 system.

Enabling SSH on Ubuntu#

If you have installed fresh Ubuntu, remote access via SSH is denied. You have to enable it for remote access. It is very easy with simple steps.

To install and enable SSH on your Ubuntu system, follow the below steps as root or user with sudo privileges:

1. First update the package index list and install the openssh-server package:

sudo apt update
sudo apt install openssh-server

It will prompt you to enter password, enter your password and hit Enter to continue to installation.

2. SSH service will start automatically, once the installation is finished. Verify SSH Service by checking status:

sudo systemctl status ssh

You should get output as following:

● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: active (running) since Sun 2020-05-31 12:27:57 UTC; 1 day 13h ago
  Process: 890 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 914 (sshd)
...

You can quit by pressing q to the command prompt.

3. If you system is secured with firewall then you should allow SSH port.

sudo ufw allow ssh

At this point SSH is installed and you can connect to your Ubuntu system via SSH from any remote system. By default, Linux and macOS systems have SSH clients pre-installed. You can connect from a Windows machine by using an SSH client such as PuTTY.

Connecting to the SSH Server#

To connect to your Ubuntu machine over network you can use the ssh command followed by the username and the IP address as following:

ssh USERNAME@IP_ADDRESS

Here, you should replace with your real username and ip address of the remote host.

For example, username is tecnstuff and ip address is 53.168.3.125 then you should run command as below:

ssh [email protected]

It will show a message when you connecting first time:

The authenticity of host '53.168.3.125 (53.168.3.125)' can't be established.
ECDSA key fingerprint is SHA256:cybd23mAJuNuBDunE++yowF7lgAs5a2bLFiO3qmLDPD.
Are you sure you want to continue connecting (yes/no)?

Type yes and you will be asked to enter password:

Warning: Permanently added '53.168.3.125' (ECDSA) to the list of known hosts.
[email protected]'s password:

On success, it will show default Ubuntu welcome message:

Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-26-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
...

This means you are now connected to remote system.

Disabling SSH on Ubuntu#

If you would like to disable the SSH server on your Ubuntu system, just stop the SSH service by typing:

sudo systemctl disable --now ssh

Again, to re-enable it, type:

sudo systemctl enable --now ssh

Conclusion#

This tutorial shown how to install and enable SSH on your Ubuntu 20.04 system. Now you can make remote session from your any client machine and do further admin tasks.

You can improve your remote machine security by changing the default SSH port, which will reduce the risk of automated attacks. To know more about SSH server read the official SSH manual page.

If you have any questions or feedback, please leave a comment below.

Related

Tags: ssh, ubuntu

Ln Command in Linux (Create Symbolic Links)

Prev Post

How to Install Skype on Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 829
  • 615,201

DesignLinux.com © All rights reserved

Go to mobile version