11
设置Linux系统SSH-KEY访问方式设置
source link: https://www.wencst.com/archives/150
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
设置Linux系统SSH-KEY访问方式设置
作者: wencst
分类: linux,Uncategorized
发布时间: 2016-08-22 17:56
阅读: 1,784 次
客户端设置
Windows
安装Git,打开git bash:
ssh-keygen -t rsa
切记要输入密码,以防被人拷贝走公钥私钥,依然有密码作为最后一道防线。
Linux
将会生成密钥文件和私钥文件id_rsa,id_rsa.pub或id_dsa,id_dsa.pub
ssh-keygen -t [rsa|dsa]
服务端设置
拷贝客户端秘钥
从Ftp中将客户端拷贝公钥文件id_rsa.pub到/root下,然后进入到/root,将公钥添加到authorized_keys中
cd /root
cat id_rsa.pub >> ~/.ssh/authorized_keys
修改SSH配置
vi /etc/ssh/sshd_config
修改关键几个参数
重启SSH服务
service sshd restart
客户端连接
连接端口需要与上述sshd_config中的Port对应
如果文章对您有用,扫一下支付宝的红包,不胜感激!
欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK