Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-21-2006, 01:41 PM
|
#1
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Rep:
|
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
|
|
|
08-21-2006, 01:50 PM
|
#2
|
Member
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Rep:
|
It's called visudo and sudo.
|
|
|
08-21-2006, 03:20 PM
|
#3
|
Senior Member
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775
Rep:
|
Code:
sudo adduser User1 admin
sudo adduser User2 admin
sudo adduser User3 admin
sudo adduser User4 admin
|
|
|
08-21-2006, 03:25 PM
|
#4
|
Member
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Rep:
|
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.
|
|
|
08-21-2006, 03:57 PM
|
#5
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Original Poster
Rep:
|
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
|
|
|
08-21-2006, 04:36 PM
|
#6
|
Member
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Rep:
|
add a group called admin and add the line
Code:
%admin ALL=(ALL) ALL
to the end of /etc/sudoers
|
|
|
08-22-2006, 11:37 AM
|
#7
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Original Poster
Rep:
|
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...
|
|
|
08-22-2006, 12:34 PM
|
#8
|
Member
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Rep:
|
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.
|
|
|
08-22-2006, 01:52 PM
|
#9
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Original Poster
Rep:
|
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..
|
|
|
08-22-2006, 02:26 PM
|
#10
|
Member
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Rep:
|
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.
|
|
|
08-22-2006, 03:41 PM
|
#11
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Original Poster
Rep:
|
I created a temp acct. and when I try the same command I get prompted for a password.
Thanks ramram29
|
|
|
08-22-2006, 04:01 PM
|
#12
|
Member
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Rep:
|
I know someone with the same nickname as you 'Cuco'.
|
|
|
08-23-2006, 04:03 PM
|
#13
|
Member
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416
Original Poster
Rep:
|
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
|
|
|
08-23-2006, 04:08 PM
|
#14
|
Member
Registered: Apr 2004
Location: Adelaide, AU
Distribution: Slackware
Posts: 48
Rep:
|
Code:
sudo usermod -G admin username
|
|
|
All times are GMT -5. The time now is 04:22 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|