LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-07-2003, 05:46 AM   #1
graffitici
Member
 
Registered: Jun 2003
Location: Istanbul - Turkey
Distribution: Fedora, Gentoo
Posts: 150

Rep: Reputation: 15
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
 
Old 09-07-2003, 06:09 AM   #2
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
You just have to type:

su

then type your root password

to become root user temporarily on the command line.



Last edited by Skyline; 09-07-2003 at 06:14 AM.
 
Old 09-07-2003, 06:15 AM   #3
graffitici
Member
 
Registered: Jun 2003
Location: Istanbul - Turkey
Distribution: Fedora, Gentoo
Posts: 150

Original Poster
Rep: Reputation: 15
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!
 
Old 09-07-2003, 08:19 AM   #4
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Rep: Reputation: 31
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.
 
Old 09-07-2003, 08:30 AM   #5
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
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!!!
 
Old 09-07-2003, 12:01 PM   #6
graffitici
Member
 
Registered: Jun 2003
Location: Istanbul - Turkey
Distribution: Fedora, Gentoo
Posts: 150

Original Poster
Rep: Reputation: 15
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?
 
Old 09-07-2003, 01:01 PM   #7
nuzzy
Member
 
Registered: Aug 2001
Location: New Hampshire, USA
Distribution: Ubuntu 6.06 LTS
Posts: 204

Rep: Reputation: 31
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.
 
Old 09-07-2003, 02:13 PM   #8
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

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

The purpse of sudo is for users not to have the root password.
 
Old 09-07-2003, 02:18 PM   #9
graffitici
Member
 
Registered: Jun 2003
Location: Istanbul - Turkey
Distribution: Fedora, Gentoo
Posts: 150

Original Poster
Rep: Reputation: 15
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??
 
Old 09-07-2003, 02:41 PM   #10
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
sudo mv files
sudo cp files
 
Old 09-07-2003, 05:15 PM   #11
shimmyt
LQ Newbie
 
Registered: Jul 2003
Distribution: Slackware
Posts: 16

Rep: Reputation: 0
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!

Last edited by shimmyt; 09-07-2003 at 05:16 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo :adduser: unable to lock password file khamdy Linux - General 9 10-13-2010 05:26 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
sudo file simeandrews Linux - General 1 06-24-2005 05:14 PM
SUDO: Can't remove file. frank_a Linux - Software 6 02-18-2005 01:52 PM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration