How to login to remote host when home directory is 777ed

邮差的信 提交于 2019-12-13 09:48:32

问题


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



来源:https://stackoverflow.com/questions/46027806/how-to-login-to-remote-host-when-home-directory-is-777ed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!