本次环境:
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 删除。