在VPS中利用vi编辑器编辑sshd的配置文件

vi /etc/ssh/sshd_config

20150618224308

找到 RSAAuthentication和PubkeyAuthentication 两行,并将前面的“#”去掉。

20150618224308 (1)

 

 

找到PasswordAuthentication行,并将后面的“yes”改为“no”。(取消密钥登录只需要把NO改成YES)

 

20150618224504

保存并退出之后,运行重启SSHD服务命令

Centos 运行

/etc/init.d/sshd restart

Debian/Ubuntu 运行

/etc/init.d/ssh restart

 

运行之后会收到成功的提示

 

20150618232251

断开SSH连接后,重新连接就可以通过密钥登录VPS了。

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:23 天前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐