码迷,mamicode.com
首页 > 其他好文 > 详细

ssh安全免密登录

时间:2019-09-15 11:28:24      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:服务   config   win   linux系统   ssh端口   art   sshd_conf   bsp   用户   

ssh key(使用非对称加密方式生成公钥和私钥)


私钥存放在本地~/.ssh目录(Linux系统)
公钥可以对外公开,复制到服务器的~/.ssh/authorized_keys文件内

win环境生成方式:xshell -> 工具 -> 用户秘钥管理者 -> 生成 -> rsa -> ..

Linux环境生成方式:ssh-keygen -t rsa(一般默认选RSA) 或 ssh-keygen -t dsa

如果服务器~/.ssh/下面无authorized_keys:touch authorized_keys
win上传公钥到服务器:复制公钥文件内容到authorized_keys中

Linux上传公钥到服务器:复制公钥文件内容到authorized_keys中
服务器端私钥加载:ssh-add ~/.ssh/imooc_rsa(仅Linux需要)

修改ssh端口:
vim /etc/ssh/sshd_config
service sshd restart

ssh安全免密登录

标签:服务   config   win   linux系统   ssh端口   art   sshd_conf   bsp   用户   

原文地址:https://www.cnblogs.com/gangzi4321/p/11521116.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!