我有一个“Amazon EC2 ubuntu”实例,并且具有keyfile(somekeyfile.pem)通过SSH访问实例。我已经与供应商共享密钥文件(somekeyfile.pem)文件以部署项目的东西。但现在我想撤销该供应商的访问权限。为此,我尝试了以下方法。在EC2实例上为Ubuntu用户强制实施密码
(1) Set root password using the command
sudo passwd
(2) Set ubuntu password using the command
sudo passwd ubuntu
(3) Modify the /etc/ssh/sshd_config
and set PasswordAuthentication yes
then restart the SSH service
(4) Modified /etc/sudoers.d/90-cloud-init-users and changed
ubuntu ALL=(ALL) NOPASSWD:ALL
to:
ubuntu ALL=(ALL) ALL
仍然供应商,我只能使用密钥对登录实例。有什么方法可以通过密钥对/ .pem身份验证来启用密码。请指导。我知道Sudo命令询问密码。
谢谢。投票 –