加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 17:18:29 所属栏目:Linux 来源:网络整理
导读:有没有办法配置SSH来检查多个用户的单个authorized_keys文件?我知道我可以将公钥复制到每个用户的authorized_keys文件中,但为了便于管理,我想为管理员提供一个额外的authorized_keys文件,允许他们登录所有用户(或特定的用户组). 解决方法 您可以使用/ etc /
有没有办法配置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”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读