FedoraThis forum is for the discussion of the Fedora Project.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
bash: visudo: command not found
# rpm -qa | grep visudo
# rpm -qa | grep sudoers
both no printout
# rpm -qa | grep sudo*
# cat /etc/sudoers
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
It runs every time you boot. But the way it's set up now the only user given privileges is root. As far as I know, you have to use visudo to change the file--that's what the manual says, anyway. Can you obtain visudo from your installation disks, or maybe download it for your distribution? Then with visudo available, you can refer to the man pages and follow the instructions for adding a user to the sudoers list. It took me a while to figure out the right way, but I got it done eventually.
P. S. Have you tried something like "locate visudo" to see if it's somewhere not in your path? If you just issue the visudo command and the program isn't in your path, it will not be found.
The '-' at the end allows you to inherit root's profile; leaving the '-' off will switch you to root, but you'll still have your own profile ($PATH, etc.). So what's happening is that you are su'ing to root, but visudo is still not in your path. It's here: /usr/sbin/visudo.
Either do a '/bin/su -', or type the full path to visudo once you su to root. then add yourself to the sudoers file.
Another trick I do is make sure that I have the same $PATH variable as root by editing /etc/profile like so:
# Path manipulation
if [ `id -u` = 0 ] || [ `id -u` = <your uid here> ]; then
So you are saying 'if the person logging on has a uid of 0 (ie 'root') OR a uid of x, then give her a $PATH of...'
This way you and root both have the same path, so sudo won't constantly complain about not finding certain executables.
Your 'uid' is the identification number that your system knows you by. your login name is only a human-friendly alias for this number. you can find your uid by looking in the /etc/passwd file. The first number is your user id number, and the 2nd is your group id number. you can see the uid numbers associated with files by typing
-- you will see the uid and gid associated with the files, instead of the human-friendly words.