Facebook Twitter Instagram
    Facebook Twitter Instagram
    Techtown
    • General
    • Linux
      • Linux Commands
      • Debian
      • Ubuntu
      • Linux Mint
      • Centos
      • OpenSUSE
      • Fedora
    • Text Editors
      • Notepad++
      • Sublime Text
    • Resources
      • Books
    • Write for Us
    Techtown
    Home » How to enable SSH on Ubuntu 20.04
    Linux

    How to enable SSH on Ubuntu 20.04

    By AMAugust 1, 2020No Comments3 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    In this post, you will learn how to enable SSH on Ubuntu 20.04 so that at the end of this post, you will be able to remotely access the computer.

    SSH

    SSH is one of the most common tools in the Linux world. Especially when we talk about servers and remote administration. In a few words, SSH (Secure Shell) is used to access remote machines, similar to the old Telnet, but securely because the connection is encrypted. This guarantees that everything we do in a session is secure.

    Equally, SSH uses the TCP protocol for communication. This guarantees that the orders will reach their destination.

    Whether you have a professional or a home server, it’s a good idea to know how to enable SSH on Ubuntu.

    Enabling SSH on Ubuntu 20.04

    Generally, Ubuntu’s modern facilities already have SSH by default. However, the package that allows us to make an SSH server which is the one we need to allow remote connections is not included.

    So open a terminal and install the openssh package

    sudo apt install openssh-server

    When the installation is complete, SSH will be enabled by the default port 22. Using the systemctl command we can make a check of the SSH status:

    sudo systemctl status sshd
    SSH status
    SSH status

    According to this screen output, SSH is active and ready to use.

    However, to further protect the connection, SSH must be configured by modifying the SSH configuration file.

    Configuring SSH on Ubuntu 20.04

    SSH is ready, but some security adjustments should be made. The SSH configuration file is /etc/ssh/sshd_config

    So, open it with the nano text editor and you will see content similar to this.

    sudo nano /et/ssh/sshd_config
    enabling and configuring SSH on Ubuntu 20.04
    enabling and configuring SSH on Ubuntu 20.04

    The file is very well documented, it’s quite easy to follow. As I mentioned before, the default port is 22. A good security measure is to change it to whatever you want.

    Port 1234

    You can also restrict access to a set of IP addresses.

    ListenAddress 0.0.0.0

    Change 0.0.0.0 to the value of the IP you want.

    It is also recommended to disable root access to SSH.

    PermitRootLogin no

    Or the number of authentication attempts:

    MaxAuthTries 3

    You can even limit the number of sessions that can be run at the same time:

    MaxSessions 4

    When you finish your changes, save the file and close the editor.

    To apply the changes, restart the SSH.

    sudo systemctl restart ssh

    Now the SSH server is ready to use. To connect and make use of SSH, on the client computer with some Linux distribution, execute the following command:

    ssh [remote-user]@[hostname-or-ip-address]

    For example:

    ssh [email protected]

    You will be asked for the user’s password and that’s it.

    Now you can have a remote terminal and remotely manage a computer.

    Conclusion

    Using a secure remote terminal is one of the most commonly used utilities on servers. This allows us to remotely manage these computers over a network. SSH is a veteran and secure implementation that allows us to do this without problems. However, we must first make some configurations to enable it.

    In conclusion, you have learned to enable SSH on Ubuntu 20.04 as you have seen it is simple and available to everyone.

    Ubuntu
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to Install Git on Ubuntu 20.04
    Next Article How to Install Docker on Ubuntu 20.04
    AM

    Related Posts

    How to Set the Time zone in Debian 11

    May 25, 2022

    How to Open a Terminal in Linux Mint

    May 24, 2022

    How to Restart Ubuntu From the Terminal

    May 23, 2022
    Add A Comment

    Comments are closed.

    Recent Posts
    • How to Set the Time zone in Debian 11
    • How to Open a Terminal in Linux Mint
    • How to Restart Ubuntu From the Terminal
    • How to Install Zoom on openSUSE
    • How to Install xArchiver on Debian 11
    Affiliate Disclosure
    This website contains Affiliate Links. We get small commission for purchases made through affiliate links (at no extra cost to you)
    Facebook Twitter Instagram Pinterest
    • Debian
    • Ubuntu
    • Mint
    • Fedora
    • CentOS
    • openSUSE
    • Chrome
    • XAMPP
    • Forums
    • Notepad++
    • Privacy Policy
    • About Me
    © 2022 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.