ssh 密钥权限被拒绝失败

ssh 密钥权限被拒绝失败

我已经在 Google 上搜索了很多次,但就是找不到确切的答案,关于这个问题有很多帖子,它们都指向检查文件权限或$HOME目录,而这在我的情况下是正确的,下面是详细信息。任何有关如何调试或解决的提示都非常感谢:

username@machine-linux2:~/.ssh$ ls -ld .
drwx------ 2 username users 0 Jan  4 23:00 .
username@machine-linux2:~/.ssh$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/usr2/username/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
open /usr2/username/.ssh/id_rsa failed: Permission denied.
Saving the key failed: /usr2/username/.ssh/id_rsa.

另外顺便提一下,我在这台机器上看到了一些奇怪的东西,echo$PATH只给出了以下内容,以前它曾经有更多的路径,不知道突然发生了什么,环境似乎乱了套:

username@machine:~/.ssh$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

相关内容