查询了网上的一些教程,然后根据自己的实际操作,记录自己实际配置ssh密钥的过程:

首先在centos终端切换到要链接的用户,比如用户ssh

使用该用户生成密钥:

ssh-keygen -t rsa

中间需要输入密钥的口令

默认会在/home/ssh/.ssh 下面生成id_rsa 和 id_rsa.pub 两个文件

将id_rsa.pub重名命为: authorized_keys

mv id_rsa.pub authorized_keys

然后将id_rsa文件剪切到需要使用putty登陆的机器上

配置sshd的配置文件,开启密钥验证

gedit /etc/ssh/sshd_config

然后去掉如下三行代码前的注释:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
UsePAM no

然后去掉密码验证

#PermitEmptyPasswords no
PasswordAuthentication no

保存重启sshd服务

service sshd restart

然后使用puttygen.exe将id_rsa转化为ppk文件

然后使用putty链接即可

我第一次链接也是遇到了错误,按照网上说的更改现需要密码验证,然后关闭,没有生效

最后重新使用puttygen.exe重新转化ppk文件,然后就可以了!

最新文章

  1. Chrome浏览器设置默认编码
  2. button按钮波纹,箭头特效css
  3. 1.GoldenGate 简单的一对一配置
  4. &与&&,|与||
  5. VM~Linux联不上网
  6. [MetaHook] Load large texture from model
  7. 转载 javascript中的正则表达式总结 二
  8. sql 随笔 2015-08-07
  9. Visual Studio 扩展包(.vsix)制作
  10. java基础(十九)IO流(二)
  11. 柯里化(Curing)
  12. 转:使用Android API最佳实践
  13. 乐在其中设计模式(C#) - 策略模式(Strategy Pattern)
  14. gcc 编译
  15. 运用经典方法进行横截面数据分类 笔记 (基于R)
  16. APP网站安全漏洞检测服务的详细介绍
  17. 关于php,python,javascript文件或者模块导入引入的区别和联系
  18. Pandas基本功能之reindex重新索引
  19. springboot 学习之路 15(集成shiro)
  20. django rest framwork教程之 viewsets和routers

热门文章

  1. 平衡二叉树(AVL)
  2. JSP/Servlet Web 学习笔记 DayThree
  3. WMware给centos6.8虚拟机添加硬盘
  4. canvas 基础
  5. thinkphp中dump()方法
  6. vue components & `@import css` bug
  7. 2017 多校4 Security Check
  8. [LeetCode169]Majority Element
  9. powerdesign相关
  10. eclipse内存不够