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.

    [email protected] ~ $ 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/24 brd 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.



  5. Summary

    By default Linux Mint does not have OpenSSH server installed. We have shown you how to quickly install and enable SSH in Linux Mint. Once installed we checked that it was configured to automatically start up on system boot and that it was running. Finally we connected to Linux Mint via SSH with PuTTY from a Windows computer.

  1. I wish I had found this page six hours ago.

  2. worked well tested using Android OS

  3. On Linux Mint 18 Cinnamon the “address” field needs to be specified as
    “ip -a” does not return a result, just the usage/help message.

    eg after prompt “ip -a address”
    or after prompt “ip -a address | grep inet”

    Thanks for the usefull article :-)

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>