SSHd禁止特定用户使用密码登录

禁止普通用户使用密码登录,编辑文件“/etc/ssh/sshd_config”:

Match User <userName>
	PasswordAuthentication no
	AuthenticationMethods publickey

如果禁止用户“root”使用密码登录:

PermitRootLogin prohibit-password

保存配置文件并重启 sshd

sudo systemctl restart sshd

已发布

分类

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注