為了系統centos的安全利用ssh RSA認證模式登入系統,windows系統利用secureCRT產生公開金鑰和私密金鑰,把公開金鑰上傳到伺服器使用者目錄/ROOT/.ssh目錄下。
[root@localhost ~]# mkdir .ssh//建立隱藏目錄.ssh
[root@localhost ~]# chmod 700 .ssh//改變許可權主為讀寫執行許可權,其它組或其它沒有許可權。
[root@localhost ~]# ssh-keygen -X -f Identity.pub >> /root/.ssh/authorized_keys
[root@localhost ~]# cd .ssh
[root@localhost .ssh]# ls
authorized_keys
[root@localhost .ssh]# cat /etc/ssh/sshd_config//查看openssh的設定檔
Protocol 2
SyslogFacility AUTHPRIV
PasswordAuthentication no//修改關閉/etc/passwd認證模式因為現在用的是RSA認證。
ChallengeResponseAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials yes
UsePAM no
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
X11Forwarding yes
Subsystem sftp /usr/libexec/openssh/sftp-server
windows平台利用secureCRT產生RSA