SSH远程登录安全设定:

1、生成密钥

使用SSH Secure Shell Client --> Edit --> Settings --> 

Global Settings--> User Authenication --> Keys-->

Generate New.. 

选择密钥类型 (DSA)密钥长度 (3072)

命名文件:auth_key

密钥使用密码:*******

 

 

使用SSH Secure Shell Client -->Quick Connect-->Authentication[Password]登录

Edit --> Settings --> 

Global Settings--> User Authenication--> Keys 

选中生成的钥匙--> Upload 上传。

 

 

使用SSH Secure Shell Client -->Quick Connect-->Authentication[Password]登录

#cd .ssh

#ssh-keygen –i –f 151auth_key.pub >> authorized_keys (转换成open ssh识别的密钥格式)

#rm –rf 151auth_key.pub

#rm –rf authorization

#chmod 600 authorized_keys

#cd ..

#chmod 700 .ssh

 

 

编辑 /etc/ssh/sshd_config

修改:PasswordAuthentication no

#/etc/init.d/sshd restart

使用SSH Secure Shell Client -->Quick Connect-->Authentication[public key]登录

4、去掉密码认证方式,使用public key认证方式

3、转换密钥格式,生成AuthorizedKeysFile: .ssh/authorized_keys

2、上传密钥