LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   sudo conf file? (https://www.linuxquestions.org/questions/linux-general-1/sudo-conf-file-90119/)

graffitici 09-07-2003 05:46 AM

sudo conf file?
 
Hi,

I am the root on my linux system, but i generally prefer to use a normal
user for obvious reasons. Yet most of the time, when I need to move some
files or folders, I get a permission error. I have heard about sudo, that
lets you run a command as another user but i can't get it to work.
When I type:
sudo mv blah blah
and write the password, I receive a wrong-password error which cannot be.
I guess there is a kina configuration file somewhere but i couldn't manage to tweak it. I read some man pages, yet couldn't understand it.

Can somebody tell me how I should change that sudo conf file??

Thanks

Skyline 09-07-2003 06:09 AM

You just have to type:

su

then type your root password

to become root user temporarily on the command line.



graffitici 09-07-2003 06:15 AM

Yes well thank you for pointing this out, but I know how to switch users with the su command and how to edit config files with emacs and vi.
My question was about the sudo conf file, the syntax and all. What lines i should add in order to give a user the ability to use certain commands, notably the mv command.

Thanks anyway!

nuzzy 09-07-2003 08:19 AM

first, as root type "visudo" to get into edit mode and add your user with the appropriate permissions. Save the file. Log in as your regular user and when you want to run something as root type "sudo command" you will be prompted for your USER password, not root's. That should work.

320mb 09-07-2003 08:30 AM

Ok, this is what mine says.....and I can do most anything when using su command........
root ALL=(ALL) ALL
make sure this line is not commented(NO hash "#" mark)
this means all users can use the "su" command. one can also specify different "groups" who can/cannot use the "su" command
I would just say this....read/read and then re-read the "man" page till you understand it!!!

graffitici 09-07-2003 12:01 PM

Quote:

Originally posted by nuzzy
you will be prompted for your USER password, not root's.
I added the following line to my sudoconf file using visudo as you had advised me:
%graffiti ALL=/bin/mv

graffiti being my normal username.But there seems to be a problem with the quoted part of your answer. Why would I enter my own pass when I am logged as a user? I would like to be able to perform the move task as if i was root. All this simply to prevent the following procedure:
$ su
//enter root pass
$ mv somethind somewhere
$ su graffiti

I would like to do this instead:
$sudo mv something somewhere
//enter root pass

Isn't that what is sudo is intended to do?

nuzzy 09-07-2003 01:01 PM

it asks for your user pass so that you won't have to use the root password for security reasons. It keeps someone from getting root's password.

darthtux 09-07-2003 02:13 PM

http://www.peakpeak.com/~jallen/rhla...istration.html

The purpse of sudo is for users not to have the root password.

graffitici 09-07-2003 02:18 PM

But then say if I have some folders to move and these folder have been created by root, sudo will not help me would it? The command mv is universal, thus adding it to the sudo conf file would be obsolete??
What should I do to cope with these folders with mv and cp then??

darthtux 09-07-2003 02:41 PM

sudo mv files
sudo cp files

shimmyt 09-07-2003 05:15 PM

I use sudo all the time, the nifty little prog. I think this is what you want to know. Make sure you have it installed first, tehn edit the sudoers file in /etc. Like you said it probably looks like this:

ROOT ALL=(ALL) ALL

Next just add a line like this for your user:

shimmyt ALL=(ALL) ALL

that will give shimmyt all access whenever I do:

sudo command

You can also limit user access and such with it. One thing though sudo makes you put in your password, not the root password before it runs the command. Oh one more thing with that ALL=(ALL) ALL it allows that user to run anything as if he was root without giving out the root password.

Good luck!


All times are GMT -5. The time now is 02:19 PM.