安全与加密2 之基于key验证的实现

基于密钥的认证:

(1) 在客户端生成密钥对
	ssh-keygen -t rsa [-P ''] [-f “~/.ssh/id_rsa"]
(2) 把公钥文件传输至远程服务器对应用户的家目录
	ssh-copy-id [-i [identity_file]] [user@]host
(3) 测试
(4) 在SecureCRT或Xshell实现基于key验证
	在SecureCRT工具—>创建公钥—>生成Identity.pub文件转化为openssh兼容格式(适合SecureCRT,Xshell不需要转化格式),并复制到需登录主机上相应文件authorized_keys中,注意权限必须为600,在需登录的ssh主机上执行:ssh-keygen -i -f Identity.pub >> .ssh/authorized_keys
(5)重设私钥口令:
	ssh-keygen –p
(6)验证代理(authentication agent)保密解密后的密钥
	这样口令就只需要输入一次
	在GNOME中,代理被自动提供给root用户
	否则运行ssh-agent bash
(7)钥匙通过命令添加给代理
	ssh-add
发布了39 篇原创文章 · 获赞 2 · 访问量 1047

猜你喜欢

转载自blog.csdn.net/weixin_45341507/article/details/102996143