xshell中生成公钥 【公钥登录配置】
文章图片
文章图片
文章图片
服务器配置
#useradd test1 #新建test1账号,用于使用公钥登录
#cd /home/test1/.ssh
#如果没有此目录就su test1;
ssh localhost;
系统将会生成对应用户的.ssh目录
#cat id_rsa_2048.pub >> authorized_keys #将生成密钥文件上传到服务器,并将内容追加到authorized_keys文件中
#vi /etc/ssh/sshd_config #添加以下两行,打开RSA与pubkey登录认证
RSAAuthentication yes
PubkeyAuthentication yes
#systemctl restart sshd.service #重启服务生效
推荐阅读
- Linux|109 个实用 shell 脚本
- linux笔记|linux 常用命令汇总(面向面试)
- Linux|Linux--网络基础
- linux|apt update和apt upgrade命令 - 有什么区别()
- linux|2022年云原生趋势
- Go|Docker后端部署详解(Go+Nginx)
- 开源生态|GPL、MIT、Apache...开发者如何选择开源协议(一文讲清根本区别)
- GitHub|7 款可替代 top 命令的工具