弹性云服务器 ECS-怎样禁用SSH密码方式连接云服务器?:操作步骤

时间:2024-09-06 10:51:30

操作步骤

  1. 登录Linux云服务器,执行以下命令编辑云服务器SSH连接方式。

    vi /etc/ssh/sshd_config

    修改如下配置项:

    把PasswordAuthentication yes改为PasswordAuthentication no

  2. 重启sshd使修改生效。

    service sshd restart

  3. 重启云服务器
  4. 通过SSH密码方式连接云服务器

    具体操作步骤,请参见SSH密码方式登录

    如果提示连接失败,说明已成功禁用SSH密码访问方式。

support.huaweicloud.com/trouble-ecs/ecs_trouble_0361.html