重启:
/etc/init.d/ssh stop
/etc/init.d/ssh start
配置:
编辑文件:vi /etc/ssh/sshd_config
Port 45830 //登录端口
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys //开启私钥登录
PasswordAuthentication no //关闭密码登录
写入公钥
添加文件~/.ssh/authorized_keys
将软件生成的key写入,重启SSH即可生效