🐧 AlmaLinux SSH Server Setup
1. Install SSH
$ sudo dnf install -y openssh-server openssh-clients
$ sudo systemctl enable sshd --now
$ sudo systemctl enable sshd --now
2. Edit Config SSH (VIM only)
$ sudo vim /etc/ssh/sshd_config
🔽 Ubah:
#Port 22
jadi:
Port 2802
Simpan dengan :wq
Restart service:
$ sudo systemctl restart sshd
3. Tes Akses
Default user:
$ ssh -p 2802 user@ip-alma
User baru:
$ sudo adduser genz
$ ssh -p 2802 genz@ip-alma
Root (sebelum di-disable):
$ ssh -p 2802 root@ip-alma
4. Disable Root Login
$ sudo vim /etc/ssh/sshd_config
Set:
PermitRootLogin no
Restart service:
$ sudo systemctl restart sshd
5. SSH Key Auth 🔑
Generate key di laptop:
$ ssh-keygen -t rsa -b 4096
Copy key ke AlmaLinux:
$ ssh-copy-id -p 2802 genz@ip-alma
Edit config:
PasswordAuthentication no
PubkeyAuthentication yes
PubkeyAuthentication yes
Restart:
$ sudo systemctl restart sshd
✅ Tes:
@ ssh -p 2802 genz@ip-alma

Komentar
Posting Komentar