← Back to all services
Ftp Sftp

SSH Default Port & Security Configuration

openssh-server systemctl: ssh

SSH server with built-in SFTP support. Most secure file transfer method.

🔌 Default Port

22
tcp
SSH/SFTP

📦 Installation Command

apt install openssh-server

⚙️ Configuration Files

  • /etc/ssh/sshd_config
  • /etc/ssh/sshd_config.d/
  • ~/.ssh/authorized_keys

📂 Default Directories

  • config: /etc/ssh
  • data: User home directories
  • logs: /var/log/auth.log
  • host_keys: /etc/ssh/ssh_host_*

🔐 Default Credentials

Username:N/A (system users)
Password:N/A (system passwords or keys)
💡 Uses system auth. Prefer SSH keys over passwords.

⚠️ Conflicts

N/A Port: dropbear

✅ Works With

fail2bangoogle-authenticator (2FA)

🛡️ Security Notes

Disable root login, use SSH keys, change default port, enable fail2ban, use AllowUsers/AllowGroups, disable password auth if possible

❓ Frequently Asked Questions

What is SSH default port?
SSH uses port 22 by default.
How to change SSH port?
Edit /etc/ssh/sshd_config, change 'Port 22' to your port, then restart sshd.
How to secure SSH?
Disable root login, use key authentication, change default port, install fail2ban.