How to Enable SSH on Debian: Step-by-Step Guide
To start SSH on Debian, you can follow these steps:
- Install SSH server: First, you need to install SSH server software. Run the following command in the terminal to install OpenSSH server.
sudo apt update
sudo apt install openssh-server
- Start the SSH service: After installation, the SSH service will automatically start. You can check the status of the SSH service using the following command.
sudo systemctl status ssh
If the SSH service is not running, you can start it using the following command:
sudo systemctl start ssh
- To enable SSH service to start automatically at boot, you can use the following command:
sudo systemctl enable ssh
- The configuration file for SSH daemon is located at /etc/ssh/sshd_config.
sudo nano /etc/ssh/sshd_config
- Firewall configuration: If your firewall is enabled, you will need to open the SSH port (default is 22). You can allow SSH traffic through the firewall using the following command.
sudo ufw allow ssh
- Restarting the SSH service: After making changes to the SSH configuration, you need to restart the SSH service to apply the changes.
sudo systemctl restart ssh
Now, your Debian system has enabled the SSH service and you can remotely connect to it using SSH.