Cấu hình SSH chứng thực dựa trên host trên hệ điều hành nhân linux CentOS 7
Trang 1CẤU HÌNH SSH HOST-BASED AUTHENTICATION TRÊN CENTOS 7
Link hướng dẫn:
http://www.lehigh.edu/~insna/OpenSSH-HOWTO-hostbased-auth.htm
SSH Server details:
OS : CentOS 7 64-bit
IP address : 192.168.28.149/24
SSH client details:
OS : Ubuntu 16.04 LTS 64-bit
IP address : 192.168.28.139/24
SSH client configuration
nano /etc/ssh/ssh_config
sửa dòng:
HostbasedAuthenication yes
thêm dòng:
EnableSSHKeysign yes
SSH daemon configuration
Tại máy server:
vi /etc/ssh/sshd_config
HostbasedAuthentication yes
IgnoreRhosts no
vi /etc/hosts.equiv
192.168.28.139
chmod 600 /etc/hosts.equiv
cp /etc/hosts.equiv /root/.shosts
ssh-keyscan -t rsa -f /etc/hosts.equiv >
/etc/ssh/ssh_known_hosts2
Trang 2Kiểm tra file ssh_known_hosts2
cat /etc/ssh/ssh_known_hosts2
Sửa file cấu hình /etc/ssh/sshd_config, vô hiệu hóa chứng thực bằng key và mật khẩu:
PasswordAuthentication no
PubkeyAuthentication no
SSH tại client thành công thành công!