LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2003, 12:03 AM   #1
frostbite
LQ Newbie
 
Registered: Aug 2003
Location: KL
Posts: 14

Rep: Reputation: 0
Using Sudo


I want to give myself root permissions by using sudo but I've been stuck at configuring the sudoers file.

Does anyone know how to configure sudo so that each time i log in i will have root permissions?
 
Old 08-08-2003, 12:16 AM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Yea, that's easy...in the sudoers file they already gave some examples of usage. So anyhow, lets say your username is "johnnie". You would add this line:

johnnie ALL=(ALL) ALL

If you noticed, root has that exact same line. That's it...you're done.

Of course you can't run root commands by just typing in the command. You have to put "sudo" before the command.

-twantrd
 
Old 08-08-2003, 12:27 AM   #3
frostbite
LQ Newbie
 
Registered: Aug 2003
Location: KL
Posts: 14

Original Poster
Rep: Reputation: 0
can i have privilages that allow me to do more things other than run commands? for example view directories or change system settings without using terminal?
 
Old 08-08-2003, 03:15 AM   #4
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Quote:
Originally posted by frostbite
change system settings without using terminal?
It is not a good IDEA for a USER to change system settings. this is what ROOT is for.
 
Old 08-08-2003, 08:17 AM   #5
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Actually I prefer the line:
Code:
username    ALL = NOPASSWD : ALL
And then you never have to enter in a password.

However, sudo is only for terminals, though there are other graphical apps that allow you to su in an X environment, like gnomesu and kdesu.
 
Old 08-08-2003, 02:22 PM   #6
frostbite
LQ Newbie
 
Registered: Aug 2003
Location: KL
Posts: 14

Original Poster
Rep: Reputation: 0
because i am the root, but i dont wanna log in using root, wanna use my name instead so i kinda have a nice home folder with my name in it and stuff
 
Old 08-08-2003, 05:55 PM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
If you search the board, it's been covered reluctantly a few times. It's really really really not a good idea. You'll be logging in as root everyday in such a situation, and then there goes half your safety net! Unless you are an uber-guru, which even then you would realize how bad it is and not do it, you shouldn't give a user all of root's priv's. Using the sudoers file is the closest I'd think one should come to doing so.

And as a side note to my above statement: If you were that guru who decided to, you'd by that time know how

Cool
 
Old 08-09-2003, 03:13 AM   #8
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
There's nothing at all wrong with granting the "normal user" that you (the actual owner and admin of the machine) "effective root" every time they log in by using the sudoers line I posted above. The only slight difference in security is that if someone can pop into your normal user's account, they can root your box. But if that's happening, you have other more serious problems already than having sudo set up the way it was. I actually highly recommend using sudo the way I described above. It makes doing admin tasks rather easy without making it so braindead as to not know what you are doing.

Note: this is the only way I advocate giving "effective root" (passwordless even) to any normal user. Setting your UID to 0 or something stupid like that, however, is ... just that, stupid.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
su and sudo muman Linux - Security 9 12-30-2004 10:55 AM
sudo pk21 Linux - Newbie 7 10-07-2003 07:53 AM
need help with sudo mla Linux - Software 4 10-02-2003 11:05 AM
sudo? nabil Linux - Security 1 02-12-2001 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:31 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