Posting ini akan menunjukkan cara Menonaktifkan HMAC MD5 dan cipher CBC sebagai contoh untuk CentOS/RHEL 6 dan 7.
Untuk CentOS/RHEL 7
Untuk informasi lebih lanjut, silakan lihat halaman manual:
# man sshd_config
Cipher
Menentukan cipher yang diizinkan. Beberapa cipher harus dipisahkan dengan koma. Jika nilai yang ditentukan dimulai dengan karakter '+', maka sandi yang ditentukan akan ditambahkan ke set default alih-alih menggantinya.
Cipher yang didukung adalah:
3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr [email protected] [email protected] arcfour arcfour128 arcfour256 blowfish-cbc cast128-cbc [email protected]
Standarnya adalah:
[email protected], aes128-ctr,aes192-ctr,aes256-ctr, [email protected],[email protected], aes128-cbc,aes192-cbc,aes256-cbc, blowfish-cbc,cast128-cbc,3des-cbc
Daftar cipher yang tersedia juga dapat diperoleh dengan menggunakan "ssh -Q cipher". Misalnya:
# ssh -Q cipher 3des-cbc blowfish-cbc cast128-cbc arcfour arcfour128 arcfour256 aes128-cbc aes192-cbc aes256-cbc [email protected] aes128-ctr aes192-ctr aes256-ctr [email protected] [email protected] [email protected]
Untuk menonaktifkan sandi CBC, harap perbarui /etc/ssh/sshd_config dengan Cipher yang diperlukan kecuali cipher CBC.
Untuk Menonaktifkan CBC:
Ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
Mulai ulang layanan sshd setelah perubahan dilakukan.
# systemctl restart sshd
MAC
MAC Menentukan algoritma MAC (kode otentikasi pesan) yang tersedia. Algoritma MAC digunakan untuk perlindungan integritas data. Beberapa algoritma harus dipisahkan dengan koma. Jika nilai yang ditentukan dimulai dengan karakter '+', maka algoritme yang ditentukan akan ditambahkan ke set default alih-alih menggantinya.
Algoritme yang berisi "-etm" menghitung MAC setelah enkripsi (enkripsi-lalu-mac). Ini dianggap lebih aman dan penggunaannya direkomendasikan. MAC yang didukung adalah:
hmac-md5 hmac-md5-96 hmac-ripemd160 hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Standarnya adalah:
[email protected],[email protected], [email protected],[email protected], [email protected], [email protected],[email protected], hmac-sha2-256,hmac-sha2-512,hmac-sha1, [email protected]
Daftar algoritma MAC yang tersedia juga dapat diperoleh dengan menggunakan "ssh -Q mac". Misalnya:
# ssh -Q mac hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 hmac-md5 hmac-md5-96 hmac-ripemd160 [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Untuk menonaktifkan algoritme MAC hmac-md5, harap perbarui /etc/ssh/sshd_config dengan Mac yang diperlukan kecuali hmac-md5 untuk ecample:
MACs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160
Mulai ulang layanan sshd setelah perubahan dilakukan.
# systemctl restart sshd
Untuk CentOS/RHEL 6
Di CentOS/RHEL 6 perintah untuk mendaftar cipher dan MAC yang tersedia adalah “sshd -T | sandi grep | perl -pe ‘s/,/\n/g’ | sort -u” dan “nmap -vv –script=ssh2-enum-algos.nse -p 22 localhost”:
# sshd -T | grep ciphers | perl -pe 's/,/\n/g' | sort -u nmap -vv --script=ssh2-enum-algos.nse -p 22 localhost
Untuk informasi lebih lanjut, silakan lihat halaman manual:
# man sshd_config
Cipher
Menentukan cipher yang diizinkan untuk protokol versi 2. Beberapa cipher harus dipisahkan dengan koma. Cipher yang didukung adalah:
3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 arcfour256 arcfour blowfish-cbc [email protected] cast128-cbc
Standarnya adalah:
aes128-ctr aes192-ctr aes256-ctr arcfour256 arcfour128 aes128-cbc 3des-cbc blowfish-cbc cast128-cbc aes192-cbc aes256-cbc arcfour [email protected]
Untuk menonaktifkan cipher CBC, harap perbarui /etc/ssh/sshd_config dengan Cipher yang diperlukan kecuali cipher CBC.
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour
Mulai ulang layanan sshd setelah perubahan dilakukan.
# service sshd restart
MAC
MAC Menentukan algoritma MAC (kode otentikasi pesan) yang tersedia. Algoritma MAC digunakan dalam protokol versi 2 untuk perlindungan integritas data. Beberapa algoritma harus dipisahkan dengan koma. Standarnya adalah:
hmac-md5,hmac-sha1,[email protected], hmac-ripemd160,hmac-sha1-96,hmac-md5-96, hmac-sha2-256,hmac-sha2-512,[email protected]
Untuk menonaktifkan algoritme MAC hmac-md5, harap perbarui /etc/ssh/sshd_config dengan Mac yang diperlukan kecuali hmac-md5 untuk ecample:
MACs hmac-sha1,[email protected],hmac-ripemd160,hmac-sha2-256,hmac-sha2-512,[email protected]
Mulai ulang layanan sshd setelah perubahan dilakukan:
# service sshd restartCara Menonaktifkan Algoritma HMAC Weak Cipher Dan Insecure Pada Layanan SSH Di CentOS/RHEL 8