-1

I am using a cloud server of godaddy & I don't have root password. My master user has root access through sudo. I was trying to create another user and set permission for a specific directory. I've created a news user testuser & created a new directory named "test" under var/www/html/. I was trying to set permission:

chmod -R 0777 /var/www/html/test

but unfortunately i press enter before mentioning the directory. That means I just change the whole permission

chmod -R 0777 /

Now, unfortunately I don't have root password & sudo, su are not working anymore. changing permission is showing

Operation not permitted

and sudo is showing the following error:

"effective uid is not 0, is sudo installed setuid root?"

I've several project live on the server. is there any way to restore the user permission. I don't want to reinstall the whole cent OS.

I've checked the ls -l and all permission are set to drwxrwxrwx

Please help me solve the problem.

2 Answers2

0

The only practical solution is to restore from backups.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
0

If your centos allows passwordless root login in Single User Mode/Rescue Mode/Emergency mode, then you can use it to restore permissions.

user1700494
  • 1,642
  • 2
  • 12
  • 21