Przejdลบ do treล›ci

๐Ÿ” SSH (Extended)

Secure Shell (SSH) is the primary method for remote server access.


๐Ÿงฉ Key-Based Authentication

Generate key:

1
ssh-keygen -t ed25519

Copy key:

1
ssh-copy-id user@server

๐Ÿ”ง SSH Configuration

Edit:

1
/etc/ssh/sshd_config

Recommended:

1
2
3
4
5
PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
X11Forwarding no
AllowTcpForwarding no

Restart:

1
sudo systemctl restart sshd

๐Ÿ› ๏ธ SSH Client Config

1
~/.ssh/config

Example:

1
2
3
4
Host prod
  HostName 192.168.1.10
  User robert
  IdentityFile ~/.ssh/id_ed25519

๐Ÿšจ Security Tips

  • Disable root login
  • Use strong keys
  • Avoid password authentication
  • Use fail2ban