我在sshd_config上添加了这些行
AuthorizedKeysCommand /authorizedkeys/authorized-keys
AuthorizedKeysCommandUser ssh-keys
-rwxr-x--- 1 root ssh-keys 712 Dec 23 22:36 /authorizedkeys/authorized-keys
-rwxr-x--- 1 root ssh-keys 712 Dec 23 22:36 authorized-keys
Run Code Online (Sandbox Code Playgroud)
ssh-keys用户可以执行该文件(/ authorizedkeys/authorized-keys).但我不能ssh到服务器; ssh git@myserver.com
在auth.log中我可以看到这一行,
error: Unsafe AuthorizedKeysCommand: bad ownership or modes for directory /
Run Code Online (Sandbox Code Playgroud)
如果我给/ authorizedkeys/authorized-keys文件授予770权限,我会收到以下错误,
error: Unsafe AuthorizedKeysCommand: bad ownership or modes for file /authorizedkeys/authorized-keys
Run Code Online (Sandbox Code Playgroud)
我尝试使用root作为AuthorizedKeysCommandUser并更改/ authorizedkeys/authorized-keys文件的权限和所有者.它也没用.
我在ubuntu 14.04上使用OpenSSH_6.6.1p1.
注意:我可以使用authorized_keys文件ssh