1. Login ke Debian
Login ke server Debian 12 menggunakan user dengan hak sudo atau root.
ssh username@192.168.73.101
2. Install OpenSSH Server
Pastikan paket openssh-server sudah terpasang.
sudo apt update
sudo apt install openssh-server -y
Cek status SSH service:
sudo systemctl status ssh
- Seharusnya status: active (running).
- Jika belum aktif, jalankan:
sudo systemctl enable ssh
sudo systemctl start ssh
3. Backup file konfigurasi SSH
Sebelum mengubah, sebaiknya backup file konfigurasi default.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
4. Ubah port SSH ke 101
Edit file konfigurasi SSH:
sudo nano /etc/ssh/sshd_config
Cari baris:
#Port 22
Ubah menjadi:
Port 101
Jika ada baris lain
Port 22, bisa di-comment atau hapus agar tidak bentrok.
Optional: bisa tambahkan juga:
PermitRootLogin no   # demi keamanan
PasswordAuthentication yes  # jika ingin login password, atau bisa pakai key
Simpan dan keluar (CTRL+O → ENTER → CTRL+X).
5. Restart SSH untuk menerapkan konfigurasi
sudo systemctl restart ssh
Cek status:
sudo systemctl status ssh
6. Konfigurasi firewall (jika aktif)
Debian 12 bisa menggunakan ufw atau iptables. Contoh ufw:
sudo ufw allow 101/tcp
sudo ufw reload
sudo ufw status
Pastikan port lama (22) bisa dihapus jika tidak ingin digunakan:
sudo ufw delete allow 22/tcp
7. Tes koneksi SSH di port baru
Dari komputer client:
ssh -p 101 username@192.168.73.101
Jika berhasil login, konfigurasi sudah sukses.