In this tutorial, we will guide you through the steps to set up Secure Shell (SSH) on Debian 11 Bullseye, the latest release from one of the most popular Linux distributions. With the most recent tips and advice, this article will help you both understand and implement SSH for secure remote server access.
Getting Started with SSH on Debian 11 Bullseye
SSH, or Secure Shell, is the de facto standard for securely accessing remote servers. Here, we’ll cover how to install, configure, and enable SSH on the latest Debian release, ensuring you have secure and easy access to your Debian system.
Installation of SSH on Debian
To begin, open the terminal and update your Debian system’s package list:
$ sudo apt update
By default, Debian does not include the SSH server in its base installation. However, OpenSSH, the most widely used implementation, is easily installable:
$ sudo apt install openssh-server
After entering your password and confirming the prompt, check that the SSH service is active:
$ sudo systemctl status ssh
If the SSH service is not already running, you can start it with:
$ sudo systemctl start ssh
Ensure the SSH service is enabled on boot to avoid having to start it manually:
$ sudo systemctl enable ssh
Discovering your server’s IP address is crucial for SSH access. Retrieve it by issuing the following command:
$ ip a
Initiating an SSH Connection
Linux distributions come with an SSH client pre-installed, which is used for initiating connections to an SSH server. Use the following command to SSH into your server:
ssh username@your_server_ip
On your first connection attempt, you will receive a message regarding the authenticity of the host. Confirm it by typing ‘yes’ to proceed.
Adjusting Firewall Settings
If you have a firewall enabled, such as UFW, you need to configure it to allow SSH connections. After ensuring UFW is installed:
$ sudo apt install ufw
Amend your firewall settings to allow traffic on the SSH port (default is port 22):
$ sudo ufw allow 22
Then activate UFW:
$ sudo ufw enable
Your firewall should now be configured, still permitting SSH connections.
How to Disable SSH
In the event that you need to disable SSH access to your Debian server:
$ sudo systemctl stop ssh
To prevent the SSH service from starting automatically on system boot:
$ sudo systemctl disable ssh
Conclusion: Setting Up SSH on Debian 11 Bullseye
By completing this tutorial, you should now have a functional SSH setup on your Debian 11 Bullseye system. SSH allows secure remote management of your system, which is fundamental for server administration tasks.
If you have any further inquiries or require clarification on any of the steps, feel free to reach out via the contact form. If this guide was helpful, your shares and feedback would be greatly appreciated.