从EC2实例中移除密钥后,我仍然可以使用该密钥访问。

huangapple go评论51阅读模式
英文:

After removing a key from ec2 instance I can still access with that key

问题

我用一个新的公钥替换了EC2实例上authorized_keys文件中的旧公钥。然后使用sudo service sshd restart重新启动了SSH服务,但我仍然可以使用旧密钥访问EC2实例。

英文:

I replaced the old public key in authorized_keys file on an ec2 instance with a new public key. I restarted the ssh service with sudo service sshd restart but I can still access the ec2 instance with the old key.

答案1

得分: 0

  • 检查是否已删除所有用户的授权密钥
  • 检查用户数据以查看脚本是否添加了SSH密钥
  • 检查/etc/sshd/sshd_config(在其他系统上可能不同)以查看是否配置了额外的授权密钥文件
  • 重新启动系统
英文:
  • Check if you removed the authorized keys for all users
  • Check userdata if the scripts add ssh keys
  • Check /etc/sshd/sshd_config (path might differ on other systems) if additional authorized_keys files are configured
  • Reboot the system

huangapple
  • 本文由 发表于 2023年3月4日 02:14:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75630553.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定