LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   How to create users with admin priviledges? (https://www.linuxquestions.org/questions/ubuntu-63/how-to-create-users-with-admin-priviledges-475976/)

cucolin@ 08-21-2006 01:41 PM

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

ramram29 08-21-2006 01:50 PM

It's called visudo and sudo.

aysiu 08-21-2006 03:20 PM

Code:

sudo adduser User1 admin
sudo adduser User2 admin
sudo adduser User3 admin
sudo adduser User4 admin


ramram29 08-21-2006 03:25 PM

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.

cucolin@ 08-21-2006 03:57 PM

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

binary_y2k2 08-21-2006 04:36 PM

add a group called admin and add the line
Code:

%admin ALL=(ALL) ALL
to the end of /etc/sudoers

cucolin@ 08-22-2006 11:37 AM

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...

ramram29 08-22-2006 12:34 PM

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.

cucolin@ 08-22-2006 01:52 PM

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..

ramram29 08-22-2006 02:26 PM

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.

cucolin@ 08-22-2006 03:41 PM

I created a temp acct. and when I try the same command I get prompted for a password.

Thanks ramram29

ramram29 08-22-2006 04:01 PM

I know someone with the same nickname as you 'Cuco'.

cucolin@ 08-23-2006 04:03 PM

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

The Seeker 11 08-23-2006 04:08 PM

Code:

sudo usermod -G admin username


All times are GMT -5. The time now is 03:25 AM.