本次环境:
centos7.6 64位
useradd test
passwd test
[test@VM-0-2-centos ~]$ ssh-keygen -t rsa
Enter file in which to save the key (/home/test/.ssh/id_rsa): #回车
Enter passphrase (empty for no passphrase): #设置密码
Enter same passphrase again: #重新输入一遍
若是普通用户test创建的密钥对,默认会保存至/home/test/.ssh/下
id_rsa #私钥,下载至本地
id_rsa.pub #公钥
/home/test/.ssh/authorized_keys权限为600
/home/test/.ssh权限为700
注:一般普通用户家目录下是没有.ssh文件的,所以.ssh和authorized_keys需自行创建。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有