LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-11-2005, 09:45 AM   #1
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Rep: Reputation: 0
[Redhat] make "admin" account same privledges as "root"


I got the normal root account and an admin account... is there a way to make the "admin" account have the same privleges as the root account? I've tried putting admin in the same group as root, but still get the "Password for root" dialog box.

I know the root password but want the 2 accounts incase i screw anything up. I just installed Linux about 3 hours ago so i'm a complete newb lol.

*EDIT*
oops posting in wrong section.. was gonna ask a Networking question but forgot to switch to the correct thread. sorry bout this..

Last edited by Bi0haZarD; 01-11-2005 at 09:47 AM.
 
Old 01-11-2005, 10:44 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Have a look at man sudoers

Edit:You must use the command:visudo as root user.
Apparently tabs are used instead of spaces.
Edit: The % is used for groups. So the admins group would have an entry like this ...
%admins ALL=(ALL) ALL
and a user admin would have an entry like this ...
admin ALL=(ALL) ALL


Where you could put a line for admins like this....
Code:
# Uncomment to allow people in group wheel to run all commands
# %wheel	ALL=(ALL)	ALL
%admins	ALL=(ALL)	ALL

Last edited by homey; 01-11-2005 at 11:10 PM.
 
Old 01-11-2005, 11:02 AM   #3
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
hope i didn't screw up this file i edited it in gedit then noticed the "MUST be changed in visuedo (or whatever)" lol.

how do i go about saving this file in visudeo..

<----



*Insert Cusswords here* seems that saving that file in gedit results in the file getting deleted or emptied.. lol.

Last edited by Bi0haZarD; 01-11-2005 at 11:09 AM.
 
Old 01-11-2005, 11:22 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Edit: Use the command: visudo as root user

press insert key to make changes
when you are done, press the esc key
To save the file with changes, type exactly: :wq!
If you decide not to save changes, type exactly :q!

Edit: If you made some errors which the visudo knows are errors, it gives you the choice to fix those errors.

Here is a copy of mine.
Code:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# 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

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

Last edited by homey; 01-11-2005 at 11:13 PM.
 
Old 01-11-2005, 04:49 PM   #5
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
ok, changed the file in vi. added:

Code:
%admin     ALL=(ALL)     ALL
but still asks for the password. do the number of spaces matter?
 
Old 01-11-2005, 05:35 PM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Edit: I'm sorry to have given you such boggus information before!
I have had a chance to try this out and have no success getting the no password part to work yet.

The file must be edited by using the command: visudo as the root user.
The admins group ( do you have an admins group on the linux box ) would seem to have an entry like this ....
%admins ALL=(ALL) NOPASSWD: ALL

Note: the file seems to be using tabs and not spaces.

The user admin would seem to have an entry like this ....
admin ALL=(ALL) NOPASSWD: ALL

Even so, I have no success yet getting this to work with no password.

Last edited by homey; 01-11-2005 at 11:21 PM.
 
Old 01-12-2005, 02:45 AM   #7
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
thanks anyways, i'll just keep entering the root password whenever need be, its not to much of a problem as its login with the password then it saves it till you tell it to forget it.

Thanks for trying and helping out a complete linux
 
Old 01-12-2005, 09:12 AM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Well I've had time to figure this out and it was too easy!
The sudoers file allows you to run the sudo command and to run it without a password!
For Example:
Using my favorite user fred to run the synaptic program requires a root password. And using the command sudo synaptic gives me this kind of output...
Code:
$ sudo synaptic

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these two things:

        #1) Respect the privacy of others.
        #2) Think before you type.

Password:
fred is not in the sudoers file.  This incident will be reported.
$
That looks kinda scary! Good thing, I'm the administrator
Now, I use the visudo command ( as root ) to add fred to the sudoers file...
fred ALL=(ALL) NOPASSWD: ALL
Saved the changes with the command: :wq!
logged in as user fred and ran the command: sudo synaptic Presto! synaptic starts up with no password required.
Now for one better, I decide to put an synaptic icon on the desktop that can be run as sudo user.
Just make a new link to application as normal.
Right click on the icon / Properties
Select: Application tab
Select: Command:sudo synaptic

Now I can click on the icon and run an application with no root password.
 
Old 01-12-2005, 09:22 AM   #9
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
yay, i'll give this a try right now. thanks

hmm.. did the sudo synaptic command before editing the sudoers file and just got "Password:" now when i run it, it says synaptic isn't a valid command..?

Last edited by Bi0haZarD; 01-12-2005 at 09:36 AM.
 
Old 01-12-2005, 09:47 AM   #10
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Maybe you need the full path on your system.
$ whereis synaptic
synaptic: /usr/bin/synaptic /usr/sbin/synaptic /usr/share/synaptic /usr/share/man/man8/synaptic.8.gz

$ sudo /usr/bin/synaptic

When you put the entry in visudo, did you use tabs instead of spaces?
fred ALL=(ALL) NOPASSWD: ALL
 
Old 01-12-2005, 09:48 AM   #11
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
yea used Tabs, i'm restarting right now cause kept logging out and it still had the keys by the clock saying i was root. so seeing if it just wasn't logging me out or what.
 
Old 01-12-2005, 09:49 AM   #12
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Why do you need a user with full root privileges? If you give a user root privileges and they screw up something on the system, it'll still affect everyone even if it's not root who has screwed up.
 
Old 01-12-2005, 09:52 AM   #13
Bi0haZarD
LQ Newbie
 
Registered: Jan 2005
Distribution: Red Hat 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
I want a user with full/high admin access root so that i can play around with stuff, if i screw it up I still have root to go back to.

(EDIT, ok that didn't make sence.. i just started linux yesterday and even a simple problem would cause hell for me lol. its like learning a new language since i've been a Windows user for about 12 years going back from windows 3.1.. if i screw around with like a language option and can't figure how to switch it back to english i still have the root account to do whatever.. thats if it doesn't make the change globally to all accounts)



doing the "whereis synaptic" only returned "syanptic:" with no path

Last edited by Bi0haZarD; 01-12-2005 at 10:02 AM.
 
Old 01-12-2005, 10:02 AM   #14
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
I just used synaptic as an example. That GUI tool for apt-get may not be installed on your box.
You could try it with the program you originally wanted to use or if you do want to install synaptic as root user, try the command: apt-get install synaptic or yum install synaptic.
 
Old 01-12-2005, 10:03 AM   #15
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
that just means that you don't have synaptic installed, don't worry about it unless you need synaptic. Synaptic is a frontend to apt a package manager. The example was just using synaptic as the command an unpriviledged user would be able to execute. do a sudo ifconfig which is normally not in a normal users path, but in roots path.

EDIT: I was beet to the punch with this post, sorry for the double.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 03:31 PM
Anybody having problems with "make" in RedHat 7.3? "cc" not found ? Rampage2884 Linux - General 4 05-14-2002 02:44 AM


All times are GMT -5. The time now is 05:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration