Debian; SSH Server
On Debian 13 (Trixie), SSH access is handled by the OpenSSH server. By default, the SSH client is installed, but the server usually isn’t.
Here’s how to enable it:
-
Install OpenSSH server
sudo apt updatesudo apt install openssh-server -y -
Enable and start the SSH service
sudo systemctl enable sshsudo systemctl start ssh
If you want to enable root login over SSH sudo vi /etc/ssh/sshd_config
uncomment PermitRootLogin yes PasswordAuthentication yes If you only want key-based login for root (more secure), place your public key into /root/.ssh/authorized_keys and set: PermitRootLogin prohibit-password PasswordAuthentication no
Restart SSH: sudo systemctl restart ssh
-
Verify the service is running
systemctl status ssh -
Adjust firewall (if applicable) If you’re using ufw (Uncomplicated Firewall):
sudo ufw allow sshsudo ufw reload
If you’re using iptables or nftables, make sure port 22/tcp is allowed.
- Connect via SSH
From another machine: ssh username@server-ip
If you want ssh to connect without trying any of your local keys, you can tell it explicitly to skip key-based authentication: ssh -o PubkeyAuthentication=no username@server-ip
Modify your ~/.ssh/config to connect with just: ssh myserver
Host myserver HostName example.com User myuser PubkeyAuthentication no PreferredAuthentications password