I did ssh into a remote Ubuntu host (Amazon EC2 instance), then set 777 permission for /home/user. After sometime the connection got closed. Now when I try to do ssh, I get error message Permission denied (publickey). How can I login again?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
- stop current instance and launch another instance with similar AMI and in the same zone.
- detach disk volume from old instance and mount to new instance.
- in the new instance, change the required file permissions inside the newly mounted volume
- detach volume from new instance and attach to old instance.
Then I was able to SSH. Steps mentioned here in detail