Linux ssh密钥生成权限被拒绝
我正在尝试为部署人员用户创建ssh密钥Linux ssh密钥生成权限被拒绝,linux,permissions,centos,ssh-keys,Linux,Permissions,Centos,Ssh Keys,我正在尝试为部署人员用户创建ssh密钥 [deployer@server /]$ ssh-keygen -t rsa -b 4096 -C "email@yahoo.com" Generating public/private rsa key pair. Enter file in which to save the key (/home/deployer/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same p
[deployer@server /]$ ssh-keygen -t rsa -b 4096 -C "email@yahoo.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/deployer/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
open /home/deployer/.ssh/id_rsa failed: Permission denied.
Saving the key failed: /home/deployer/.ssh/id_rsa.
所有这些我都试过了
[root@server /]# chmod -R 644 /home/deployer
[root@server /]# chmod -R 755 home/deployer
[root@server /]# chmod -R 755 /home/deployer
[root@server /]# chmod -R 755 home/deployer
看起来您没有权限保存完成操作所需的文件。尝试使用
sudo
运行相同的命令:
sudo ssh-keygen -t rsa -b 4096 -C "email@yahoo.com"
当提示输入密码时,请输入您的密码。如果这不起作用,您可以尝试使用命令
su
,该命令将直接切换到root
用户。看起来部署者
不是其主目录的所有者。试着给他所有权:
[root@server/]#chown-R部署器:/home/deployer/
尝试以下操作:
1) cd/主/展开器
2) ssh-keygen-t
3) chmod 700.ssh您是该目录的所有者吗?