linux – SSH:一个用于多个服务帐户的authorized_keys

前端之家收集整理的这篇文章主要介绍了linux – SSH:一个用于多个服务帐户的authorized_keys前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有办法配置SSH来检查多个用户的单个authorized_keys文件?我知道我可以将公钥复制到每个用户的authorized_keys文件中,但为了便于管理,我想为管理员提供一个额外的authorized_keys文件,允许他们登录所有用户(或特定的用户组).

解决方法

您可以使用/ etc / ssh / sshd_config中的AuthorizedKeysFile指令来执行此操作. defaut位置是.ssh / authorized_keys但你可以使用包含绝对路径的东西,例如
AuthorizedKeysFile /path/to/your/keyfile

手册页说明了这一点

AuthorizedKeysFile

Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection setup. The following tokens are defined: %% is replaced by a literal ’%’,%h is replaced by the home directory of the user being authenticated,and %u is replaced by the username of that user. After expansion,AuthorizedKeysFile is taken to be an absolute path or one relative to the user’s home directory. The default is “.ssh/authorized_keys”.

猜你在找的Linux相关文章