LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-21-2006, 01:41 PM   #1
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Rep: Reputation: 31
Question How to create users with admin priviledges?


Hello, I have 4 users on a LAMP server:

User1
User2
User3
User4

I would like to know how to set these users as admin. like in Windows. I'm root, but I want them to be able to perform administrative task such as making changes to Apache, MySQL, etc.. For MySql do I have to create a separate account for MySql or can they use the same login name?

Thanks for your help
 
Old 08-21-2006, 01:50 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
It's called visudo and sudo.
 
Old 08-21-2006, 03:20 PM   #3
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Code:
sudo adduser User1 admin
sudo adduser User2 admin
sudo adduser User3 admin
sudo adduser User4 admin
 
Old 08-21-2006, 03:25 PM   #4
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
You have to run visudo first and uncomment the wheel group. Then you'll need to add the admin users to the wheel group in /etc/group. Afterward you can run any command using the sudo command.
 
Old 08-21-2006, 03:57 PM   #5
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
Thanks ramram29 and aysiu. When I run "sudo adduser User1 admin" I get:

'The group admin does not exist'

ramram29 I don't see andy wheel group here at the the visudo file, when I run the visudo command this is what I get:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults

Defaults !lecture,tty_tickets,!fqdn

# User privilege specification
root ALL=(ALL) A

I'm confused!!
Thanks for your help
 
Old 08-21-2006, 04:36 PM   #6
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
add a group called admin and add the line
Code:
%admin ALL=(ALL) ALL
to the end of /etc/sudoers
 
Old 08-22-2006, 11:37 AM   #7
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
I added the line: "%admin ALL=(ALL) ALL" using visudo, then when I ran the command "sudo adduser User1 admin" I got: The group 'admin' does not exist. Do I have to do addgroup admin as well??

Thanks...
 
Old 08-22-2006, 12:34 PM   #8
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
1. Uncomment or add the admin group to the sudoers file. As root type 'visudo'. It will enter the file in vi. In the sudoers file uncomment or add the group admin as '%admin ALL=(ALL) NOPASSWD: ALL'. Comment all the other lines. In Ubuntu the group is called admin and in Fedora and SUSE it's called wheel. Exit and save this file by pressing :wq.

2. Edit /etc/group and make sure the admin group contains the accounts that you want to have root priviledge. For example,

admin:x:19:user1,user2,user3

Only add the users. The number 19 is the group number - you don't have to change the group number that is already there.

3. Logged in under any of these accounts you can then type the command 'sudo' followed by any command with root priviledge and it will let you run that command. For example, 'sudo shutdown -r now' will allow you to restart the system logged in as user1, who is a member of the sudoers group.
 
Old 08-22-2006, 01:52 PM   #9
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
ramram29 I did not see any admin I saw 'adm:x:4:' I placed the users here and I was able to do step 3 above. So I guess this is the solution.

Thanks..
 
Old 08-22-2006, 02:26 PM   #10
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
If you where able to restart Linux as stated above then it should be working. To very, try to type the same root priviledge command using an account that is not a sudoer.
 
Old 08-22-2006, 03:41 PM   #11
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
I created a temp acct. and when I try the same command I get prompted for a password.

Thanks ramram29
 
Old 08-22-2006, 04:01 PM   #12
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
I know someone with the same nickname as you 'Cuco'.
 
Old 08-23-2006, 04:03 PM   #13
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
But I'm cucolin@. Hey ramram29 evethough I made users with admin priviledges I still need to give them permissions for the files. I cannot make any changes with those users acct. to the /var/www files that I have there or some apache files.

Thanks
 
Old 08-23-2006, 04:08 PM   #14
The Seeker 11
Member
 
Registered: Apr 2004
Location: Adelaide, AU
Distribution: Slackware
Posts: 48

Rep: Reputation: 18
Code:
sudo usermod -G admin username
 
  


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
How do I create a admin user for FTP? dwz3591 Linux From Scratch 1 07-03-2005 06:47 AM
redirect all users mail to admin tanveer Linux - Networking 4 03-03-2005 09:39 PM
Postfix Admin tool not able to create mailbox davidbalt Linux - Networking 1 09-22-2004 10:02 PM
Giving users more rights (Admin) FatSteve Linux - Security 7 11-19-2003 06:37 AM
Best way to remote admin: users? TruckStuff Linux - Security 6 06-01-2002 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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