Trending News

Blog

Installing SSH on Ubuntu 24.04 LTS Running Linux
Blog

Installing SSH on Ubuntu 24.04 LTS Running Linux 

Secure Shell (SSH) is an essential tool for system administrators and developers who want to securely access and manage remote systems. With the release of Ubuntu 24.04 LTS, the need to set up SSH remains just as critical for anyone managing servers from a distance. Whether you’re new to Ubuntu or just need a refresher, this article will guide you through the process of installing and configuring SSH effectively.

Why Use SSH?

SSH allows users to log into another computer over a network, execute commands, and move files securely. Unlike older protocols such as Telnet, all communications over SSH are encrypted, making it ideal for administering remote servers.

With Ubuntu 24.04 LTS focusing on enterprise readiness and long-term support, installing and securing SSH is one of the first steps you should take after spinning up a server or a local development environment.

Step-by-Step: Installing SSH

Installing SSH on Ubuntu 24.04 LTS is straightforward. Follow these steps to get started:

  1. Open the Terminal: You can do this by pressing Ctrl + Alt + T or by searching for “Terminal” in your applications menu.
  2. Update Your Package List: It’s always a good idea to update your system before installing any new package. Use the following command:

    sudo apt update
  3. Install OpenSSH Server: This is the package that includes the SSH daemon.

    sudo apt install openssh-server
  4. Enable and Start the SSH Service: This ensures SSH runs on startup.

    sudo systemctl enable ssh
    sudo systemctl start ssh
  5. Verify SSH Installation: You can check if it’s working by running:

    sudo systemctl status ssh

Once installed, your Ubuntu 24.04 system is ready to accept SSH connections. By default, it listens on port 22, and the service is called sshd.

Basic SSH Usage

After installation, SSH can be used to connect to the machine using the following syntax:

ssh username@server-ip

Replace username with your actual user name and server-ip with the IP address of the Ubuntu machine. If you’re connecting from within the same network, you can find the IP using:

ip a

If everything is working correctly, you will be prompted to log in using your user credentials or a key pair, if set up.

Securing Your SSH Installation

SSH is secure by design, but you can take additional steps to harden it. Here are a few recommended configurations:

  • Change the Default Port: This helps reduce the chance of automated attacks.

    Edit the file: /etc/ssh/sshd_config and change Port 22 to a different number.
  • Disable Root Login: For extra security, prevent the root user from logging in via SSH.

    In sshd_config, set PermitRootLogin no.
  • Use SSH Key Authentication: Instead of passwords, use SSH keys for stronger, more convenient authentication.

After making changes to the configuration file, restart the SSH service:

sudo systemctl restart ssh

Testing the Connection

If you’re configuring Ubuntu 24.04 in a cloud environment (such as AWS, Azure, or DigitalOcean), you’ll typically connect to the instance using a pre-generated SSH key. However, for local or on-premises servers, verify your SSH setup by connecting from another machine or using tools like PuTTY on Windows.

Troubleshooting Tips

If you encounter issues, here are a few things to check:

  • Confirm the SSH service is running:

    sudo systemctl status ssh
  • Ensure the firewall allows SSH:

    sudo ufw allow ssh
  • Check for typos in /etc/ssh/sshd_config and test syntax with:

    sudo sshd -t

Conclusion

Installing and configuring SSH on Ubuntu 24.04 LTS is a crucial step in managing your system remotely and securely. With its long-term support and modern features, Ubuntu 24.04 makes an excellent platform for developers and system administrators alike. By taking time to configure your SSH server securely, you not only gain powerful access to your system but also reduce the risk of unauthorized intrusion.

Whether you’re building a home lab, deploying cloud instances, or managing enterprise infrastructure, having a solid understanding of SSH will serve as an invaluable asset in your Linux toolkit.

Related posts

Leave a Reply

Required fields are marked *