我有一個「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命令詢問密碼。
謝謝。投票 –