Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I rented a server (ubuntu 12.04). They gave me a root user account.

Next, I went in and created a new user using:

# adduser <newusername>

And added a password.

The new user account works fine. I can SSH into that account with its username and password.

However, when I'm in my new user account, I can no longer use:

sudo

If I do something like:

sudo apt-get install build-essential

or something like:

sudo su

I get the message:

sudo: must be setuid root

Help?

(I'm aware of similar questions asked before, but couldn't find my solution there.)

share|improve this question
1  
Normally /usr/bin/sudo should be owned by root and yes, the setuid bit must be set. Can you do a ls -l $(which sudo)? –  noggerl Oct 15 '13 at 20:52
    
Thanks for helping. I did it, here's the output "-rwxr-xr-x 1 root root 69708 Jun 1 2012 /usr/bin/sudo" –  user1883050 Oct 15 '13 at 20:56
    
Just posted an answer. But please do me a favor: before you proceed with your server and maybe something nasty happens read a few tutorials about internet server security and linux administration basics, because setuid on the wrong executables can be very dangerous. –  noggerl Oct 15 '13 at 21:03
    
Advice taken. Thanks. –  user1883050 Oct 15 '13 at 21:14

1 Answer 1

I don't know why but the setuid bit on the sudo executable is not set, which is needed to work properly.

To set this just do a chmod u+s $(which sudo). The statement $(which sudo) finds the path where in the filesystem the sudo executable is found (normally /usr/bin/sudo), so the command expands to chmod u+x /usr/bin/sudo. For more details on special bits on Linux/Unix-Systems just look at Wikipedia

share|improve this answer
    
OK, we're may be making progress. I did that, and now when I try to sudo inside my username "username1", I get the following message: "username1 is not in the sudoers file. This incident will be reported." –  user1883050 Oct 15 '13 at 21:07
    
So please see here: google.de/#q=sudo+configuration because I've got the feeling that you're missing a lot of linux administration basics. –  noggerl Oct 15 '13 at 21:11
    
I definitely am. I'm a newbie at this. Problem is that littlest things in Linux admin are so vast, that they are intimidating. But thank you very much for this link, I'm going to explore sudo configuration. –  user1883050 Oct 15 '13 at 21:14
    
Maybe you should also look into these (the last two I use for myself often): google.com/#q=linux+administration+basics - cyberciti.biz/tips/linux-security.html - plusbryan.com/… –  noggerl Oct 15 '13 at 21:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.