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

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...