Dav*_*ski 2 ssh configuration authentication
我想知道是否可以只对一个用户(管理员)强制使用基于 SSH 密钥的身份验证,并允许系统上的所有其他用户(不包括 root,其 ssh 登录已在 sshd_config 中禁用)通过密码进行身份验证。
您可以通过修改您sshd_config
的添加来做到这一点:
Match User <username>
PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)
您也可以通过使用Match Group
代替对组执行相同的操作
sshd
之后别忘了重启