How To Enable SSH in Linux Mint and Discover Online Systems

driver76
  6 years ago
  0

How To Enable SSH in Linux Mint

 

By default OpenSSH server is not installed in Linux Mint. This quick guide will show you how to install and enable SSH in Linux Mint, allowing you to remotely access the operating system over the network through SSH.

Enable SSH in Linux Mint

1.      Open Terminal
We’ll be doing this through command line, so begin by first opening up a terminal. You can find the terminal icon in the task bar in a default GUI installation, as shown below.

 

Linux Mint Open Terminal

2.      Install OpenSSH Server
Within the terminal, run the following command as root to install the OpenSSH server package.

 

                                 apt-get install openssh-server -y

apt-get install openssh-server

Note: You must do this with root privileges, otherwise you will receive the following error message:

                                 E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

You can become root by running ‘sudo su’, followed by your password. By default the first account that you create when you install Linux Mint should be able to become root.

3.      Check OpenSSH Status
Once installed SSH should be automatically configured to start on system boot, and be already running. We’ll of course check this though rather than just assuming!

 

We can use ‘systemctl is-enabled’ as shown below to check that ssh is enabled to start automatically on system boot. If it comes back with ‘enabled’ then SSH should automatically start up on boot. If it’s disabled, you can run ‘systemctl enable ssh’ to enable to to start up on system boot.

                                 systemctl is-enabled ssh

We can then use ‘systemctl is-active’ as shown below to check that ssh is currently active and running. If it comes back with ‘active’ then SSH is currently running. If it’s not running, you can run ‘systemctl start ssh’ to start it up.

                                 systemctl is-active ssh

We can also use ‘systemctl status’ to get a quick overview of all information, in the example below we can see that it’s actively running as well as various useful information about the service.

Linux Mint systemctl ssh

4.      Testing SSH Access
In this example we have confirmed that SSH is configured to start up on system boot automatically and is currently running, so let’s try and SSH to it from an external Windows system! We’ll do this using PuTTY.

 

You can display the IP address of the Linux Mint machine by running ‘ip a’ from the terminal.

                                 rootusers@rootusers-virtual-machine ~ $ ip a

2: ens33:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:d3:f5:b0 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.20/24brd 192.168.1.255 scope global dynamic ens33

       valid_lft 83316sec preferred_lft 83316sec

    inet6 fe80::3286:aa53:7220:5fa7/64 scope link

       valid_lft forever preferred_lft forever

We can see here that the IP address of our Linux Mint system is 192.168.1.20, so we’ll SSH to this using PuTTY from Windows. All you need to do is specify your username and password.

Linux Mint SSH Test

Note that by default the user ‘root’ will not have SSH access. This behaviour can be modified by editing the PermitRootLogin value in the ‘/etc/ssh/sshd_config’ file and then restarting SSH.

That’s all there is too it! We have now successfully established an SSH connection from Windows to Linux Mint, allowing us to remotely administer the Linux system over the network by running various commands via SSH.

 

Request a Login 

Paul Allen maintains several publicly accessible historic computer systems, including an XKL TOAD-2 running TOPS-20. Request a login from Living Computers: Museum + Labs and try running TOPS-20 on a hardware emulated PDP-10.

Comments
technotricks 3 years ago

Thanks for this, helped me get it up and running on both my devices.