0

I accidentally ran this command chmod -R 755 /usr/bin on my remote server [Ubuntu 12.04.3 LTS], and I don't have the root password.

When I run sudo it gives me sudo: must be setuid root, This is the /bin folder permissions

drwsr-xr-x   2 deployer root 40960 juil. 23 11:54 bin

SSH connexion is the only access I have to my remote server.

ayb
  • 3

1 Answers1

2

Your error message is caused by sudo being owned by deployer, in addition, the rights are set incorrectly. To fix the permissions, try something like chmod 4755 /usr/bin/sudo, as you own sudo currently.

To fix the ownership, you need to run chown root:root /usr/bin/sudo ...but you might need to be root for that. Unless you have +s set on /bin/chown, and without root password or recovery console/alternative boot method, there is probably no way. So, you can try the above chown command with your normal user, but most likely you will have to re-install.

More similar questions:

Error after sudo-ing "sudo: must be setuid root"

sudo: must be setuid root

noleti
  • 4,103
  • 28
  • 27