微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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”.

原文地址:https://www.jb51.cc/linux/399924.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐