1.

Solve : sudo: must be setuid root error?

Answer»

Hi, I am working on a server that I am remotely connecting to and recently made a mistake with file ownership. The sudo file was among the files that changed owner and now I am getting 'sudo: must be setuid root' anytime I try a sudo command. I had the administrator change the owner of this file back to root and now when I run 'ls -l sudo' on the sudo file I get

-rwxr-xr-x 1 root root 225800 Jan 5 2012 sudo.

These permissions seem right but I am still getting the error. I am trying to find a way to fix this without having to reboot, any help is much appreciated.

Thank youQuote

sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user (normally the superuser ...
Some here may not understand what you are doing. You are using sudo on a remote server. Is it some recent version of a Linux server? Is it Fedora?
Quote
There are two ways to run administrative applications in Linux. You can either switch to the super user (root) with the su command, or you can take advantage of sudo. How you do this will depend upon which distribution you use. Some distributions enable the root user (such as Fedora, Red Hat, openSuSE), while some do not (such as Ubuntu and Debian). There are pros and cons for each.
It looks like I'm running SUSE Linux Enterprise Server (using the 'lsb_release -a' command) and I am on a windows machine using an ftp tool to remotely connect to the linux server. I am trying to use 'sudo su' to log in as root but I get that error.I want to help, if I can.
First of all, I am not a current IT professional. Requirement CAME many years ago. What I know about serves and Linux is only has a personal computer user.
Never have I been able ton control anything with a FTP client other that list files in directories, change directories and upload and download files.

Servers for domain names often allow limited control of the remote system. For security reasons. Some of the old loopholes in Linux have been closed. A domain owner on a shared server can only get into his 'root' and nothing higher. The 'root' for a domain is really a user space on the Linux system.

Also, a FTP account can be, is some cases, limited to a sub directory and cannot more up in the directory of the domain.

My only experience of server control is via some KIND of control panel that is a server-side graphical interface. The most common is called cpanel.
When I setup a new domain on a server, it does not get full use of the server. INSTEAD, the user must use the cpanel to make changes.
https://cpanel.net/demo/
Above is a demo of cpanel. Does your server offer this kind of thing?
Where about is this 'sudo' file located on the disk?

What actually happened when you 'made a mistake with file ownership' - If this has taken a large number of files with it the problems could run a lot deeper than not being able to use sudo in which case a full reinstall may be a better option?I had run a recursive command changing the owner of all of the files in the home directory to a specific non-root user (yes this is a very bad thing). It got about halfway through before I STOPPED it. Now the admin has changed all of the home files so that each user owns its own files.To answer your specific question ...

The error states that sudo must be setuid, and this is not so:
Code: [Select]-rwxr-xr-x 1 root root 225800 Jan 5 2012 sudo
To just fix that, you need to execute
Code: [Select]chmod u+s sudo
However ...

You did say that you only ran chown and not chmod and this affected many files on the system, so I would strongly recommend that you should restore the whole system from backup.

BTW, many times at this point I hear people say, but I haven't got a backup. To which my response is the same as Captain Mainwaring says to Pike "stupid boy"
NB: A mirror is not a backup. If you run the wrong command and destroy your data, then a mirror will give you 2 copies of garbage.


Discussion

No Comment Found