0

I was trying to change a folder owner user from root to jenkins, and accidently did chown on ALL of the filesystem recursively. now I ended up without any permission.

root@vps412690:/# ls
-bash: /bin/ls: Permission denied

I can't even use the command chmod, no permission to use it.

I can't even log in to my server.

 /bin/bash: Permission denied

Any idea?

TheUnreal
  • 97
  • 4
  • 1
    restore the backup is the easiest way in my point of view – djdomi Aug 19 '19 at 18:13
  • I don't have backup – TheUnreal Aug 19 '19 at 18:14
  • Login as the jenkins user maybe ? but I hope you can restore somehow .. – yagmoth555 Aug 19 '19 at 18:15
  • then to be fairly honestly reinstall it, if you dont backup before doing changes or dont done any yet will lead you to learn it hardly. – djdomi Aug 19 '19 at 18:16
  • I did run some commands after I moved it to the jenkins user, I moved it back to the root user but not sure which command totally destroyed my permissions later – TheUnreal Aug 19 '19 at 18:17
  • UPDATE: I can access my server with OVH Rescue mode as wrapper linux and my linux mounted on it, what can I do from there? – TheUnreal Aug 19 '19 at 18:37
  • Did you read the dupe ? you can chown as root:root – yagmoth555 Aug 19 '19 at 18:41
  • Thanks @yagmoth555, I followed it and run the commands to get back the permission, but for some reasons when I am trying to access my VPS after restart I get `Connection closed by xxx port 22`, altough I see the nginx server up. any idea? – TheUnreal Aug 19 '19 at 19:12
  • The SSH authorized keys file needs to be owned by your user if you expect SSH to accept it. Honestly though, you should reinstall that system, I'm assuming this is a novice Debian like system, which means you most likely had setuid binaries with specific group permissions at places that you most certainly nuked, that system will break later down the road in more ways than one. – Ginnungagap Aug 19 '19 at 21:32

0 Answers0