Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use to be a fans of Ubuntu, when I want to execute a command as root user, I do this sudo blah_blah_blah. But in Fedora 16, it doesn't seem recognize this command. Any clue on this?

share|improve this question
4  
it sounds like you dont have sudo installed. yum install sudo –  h3rrmiller Nov 15 '12 at 13:52
1  
@huahsin68 What is the actual error you are seeing? This is important because in Fedora the user must be specified in the _'#/etc/sudoers' file –  midnightsteel Nov 15 '12 at 14:05
    
when I type the command, it shows me the user manual sample usage. It doesn't sound sudo is not install, just that the usage is wrong. –  huahsin68 Nov 16 '12 at 1:54
add comment

1 Answer

up vote 2 down vote accepted

If your shell tells you it can't find sudo then it's not installed and you will need to install it using yum install sudo. If it is installed, then it's likely you are not in the admin group, which you can solve that by doing adduser <username> admin. If you don't want to do that, then go ahead and add yourself to /etc/sudoers. Be sure to edit it with visudo.

Edit

When using visudo you need to just add the following if you want to be able to run all the commands that root runs.

sparticvs   ALL=(ALL) ALL

To understand the format it goes a little like this <username> <machine>=(<allowed-euids>) <commands> and ALL is a keyword wildcard here. The allowed-euids are not required, but they basically help restrict who you can run as. For instance you can define a group of users like User_Alias DB = mysql, psql and then use the command sparticvs ALL=(DB) /usr/bin/mysql, /usr/bin/psql which would allow me to run the mysql and psql commands as the service accounts that own them by doing sudo -u psql /usr/bin/psql. Just so I don't completely leave you wondering why there is a machine requirement, you can require that the source of the user that is connected comes from a trusted network. For instance, I have sudo rules that only allow sudo to be done by someone from a trusted host and all other calls to sudo are disallowed.

share|improve this answer
    
you mention /etc/sudoers, any clue on doing that? –  huahsin68 Nov 16 '12 at 1:56
    
I went ahead and clarified further above. Also, for more in-depth information about sudoers file see man sudo –  sparticvs Nov 16 '12 at 19:28
    
Great help. Thank you so much on your answer. –  huahsin68 Nov 17 '12 at 6:49
add comment

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.