This morning I applied permission 0777 to a folder (with .ssh
) on AWS. After that, SSH access does not work, without any error or message - just hung screen. Anyone help me.
-
askubuntu.com/questions/1004896/ssh-folder-permitted-to-777– steeldriverJun 13, 2018 at 5:59
-
2Why on earth do you want to have those permissions? In short you can't, because that would allow any user to replace your keys and impersonate you.– vidarloJun 13, 2018 at 6:25
-
See also stackoverflow.com/questions/9270734/…– PantherJun 13, 2018 at 7:25
2 Answers
SSH does not allow you to fully open permissions on its folder. Period. Permissions set to 777 means that others can hi-jack your private keys.
Why in the world would you even consider opening a directory containing ssh keys with full permissions?
You DID get messages about this in the log on your server. I would suggest it is a bad idea to provide messages to the user about permissions since it would help the person trying to invade your system. And yes, that also includes protecting you from yourself.
The better and only the solution is to:
Take a new- temporary ec2 instance, and attach your old server's volume to it & then revert the permissions of .SSH to default. And then re-attach the volume back to it's old server, then you can able to access your server.