LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 11-21-2005, 08:04 PM   #1
sleepykit
Member
 
Registered: Sep 2005
Distribution: Mandriva 2007 & Ubuntu Fesity Fawn
Posts: 67

Rep: Reputation: 15
Making an account an admin?


I would like to know if there's a way on Mandrake 10.1 acting as a Server to make an account besides root an administrator.
 
Old 11-21-2005, 09:38 PM   #2
mijohnst
Member
 
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 419

Rep: Reputation: 31
Not a good idea... If you want one account besides root to have that much power then I suggest using sudo.
 
Old 11-22-2005, 05:22 PM   #3
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
I think the only way to make an account an admin is to give them a user ID of 0, which is the same as root's. This will not do what you want since it will make the user's indistinguishable from the root user. Eg. if you look at a file that is owned by root (ie. owned by the user with UID of 0) it may either show as being owned by root or by one of your other 'rootified' users.

As mijohnst said just use sudo. Add an entry like this:
Code:
su -
visudo
Now in the editor that comes up under "# User privilege specification":
Code:
myusername     ALL=(ALL) ALL
this will give myusername full access to the system.
 
Old 11-22-2005, 08:13 PM   #4
sleepykit
Member
 
Registered: Sep 2005
Distribution: Mandriva 2007 & Ubuntu Fesity Fawn
Posts: 67

Original Poster
Rep: Reputation: 15
Thank you very much for your help. That really helps out, although you are both right of course. SImply using console and the su command when needed is probably best. The trouble with this is that I am on someone else's machine and need access to the var/www directory to work on the web pages. Problem with that is that only root is allowed to access those files and it seems like a terrible idea to allow everyone to get into them when only two people are actually doing any editing in there.

Thanks much.

Anna
 
Old 11-22-2005, 08:17 PM   #5
mijohnst
Member
 
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 419

Rep: Reputation: 31
Why don't you have them create you an account and then change the permissions of the directory to give you read/write. Create a group, add your two accounts into the group and then chown the directory to the group. Is that what you mean?
 
Old 11-22-2005, 10:08 PM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally posted by mijohnst
Why don't you have them create you an account and then change the permissions of the directory to give you read/write. Create a group, add your two accounts into the group and then chown the directory to the group. Is that what you mean?
I think it would be better this way compared to having two different users with all root privileges.
 
Old 11-23-2005, 12:43 PM   #7
sleepykit
Member
 
Registered: Sep 2005
Distribution: Mandriva 2007 & Ubuntu Fesity Fawn
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by mijohnst
Why don't you have them create you an account and then change the permissions of the directory to give you read/write. Create a group, add your two accounts into the group and then chown the directory to the group. Is that what you mean?
How exactly would I go about doing all that? I know how to create a new account, but the rest of it is gray area.

Thank you in advance.
 
Old 11-23-2005, 12:55 PM   #8
mijohnst
Member
 
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 419

Rep: Reputation: 31
Quote:
useradd user_name
passwd user_name
(as root) Create a new account (you must be root). E.g., useradd barbara Don't forget to set up the password for the new user in the next step. The user home directory (which is created) is /home/user_name. You may also use an equivalent command adduser user_name

ls -l /home/peter
useradd peter -u 503 -g 503
(as root). Create an account to match an existing directory (perhaps from previous installation). If the user ID and the group ID (shown for each file) were both 503, I create an account with a matching user name, the user ID (UID) and the group ID (GID). This avoids the mess with changing the ownership of user files after a system upgrade.

userdel user_name
Remove an account (you must be a root). The user's home directory and the undelivered mail must be dealt with separately (manually because you have to decide what to do with the files). There is also groupdel to delete groups.


groupadd group_name
(as root) Create a new group on your system. Non-essential on a home machine, but can be very handy even on a home machine with a small number of users.

For example, I could create a group "friends", using
groupadd friends
then edit the file /etc/group, and add my login name and the names of my friends to the line that lists the group, so that the final line might look like this:
friends:x:502:stan,pete,marie
Then, I can change the permissions on a selected file so that the file belongs to me AND the group "friends".
chgrp friends my_file
Thus, the listed members of this group have special access to these files that the rest of the world might not have, for example read and write permission:
chmod g=rw,o= my_file
The alternative would be go give write permission to everybody, which is definitely unsafe even on a home computer.

groups
List the groups to which the current user belongs. Or I could use groups john to find to which groups the user john belongs.
usermod
groupmod
(as root) Two command-line utilities to modify user accounts and groups without manual editing of the files /etc/passwd /etc/shadow /etc/group and /etc/gshadow. Normally non-essential.

userconf
(as root) Menu-driven user configuration tools (password policy, group modification, adding users, etc). Part of linuxconf package, but can be run separately.

passwd
Change the password on your current account. If you are root, you can change the password for any user using: passwd user_name

chfn
(="change full name"). Change the information about you (full name, office number, phone number, etc). This information is displayed when the finger command is run on your login_name.

chage -M 100 login_name
(= "change age"). Set the password expiry to 100 days for the user named login_name .

quota username
setquota username
quotaon /dev/hda
quotaoff /dev/hda
A set of commands to manage user disk quotas. Normally not used on a home computer. "Disk quota" means per-user limits on the usage of disk space. The commands (respectively) display the user quota, set the user quota, turn the quota system on the for a given filesystem (/dev/hda in the above example), turn the quota system off. "Typical" Linux distros I have seen set on default: no limits for all users, and the quota system is off on all filesystems.

kuser
(as root, in X terminal) Manage users and groups using a GUI. Nice and probably covering most of what you may normally need to manage user accounts.

chmod perm filename
(=change mode) Change the file access permission for the files you own (unless you are root in which case you can change any file). You can make a file accessible in three modes: read (r), write (w), execute (x) to three classes of users: owner (u), members of the group which owns the file (g), others on the system (o). Check the current access permissions using:
ls -l filename
If the file is accessible to all users in all modes it will show:
rwxrwxrwx
The first triplet shows the file permission for the owner of the file, the second for the group that owns the file, and the third for others ("the rest of the world"). A "no" permission is shown as "-".
When setting permissions, these symbols are used: "u"(=user or owner of the file), "g"(=group that owns the file), "o"(=others), "a" (=all, i.e., owner, group and others), "="(=set the permission to), "+"(=add the permission), "-"(=take away the permission), "r"(=permission to read the file), "w"=(write permission, meanning the permission to modify the file), "x"(=permission to execute the file).

For example, this command will add the permission to read the file junk to all (=user+group+others):
chmod a+r junk
This command will remove the permission to execute the file junk from others:
chmod o-x junk
Also try here for more info.
You can set the default file permissions for the new files that you create using the command umask (see man umask).
chown new_ownername filename
chgrp new_groupname filename
Change the file owner and group. You should use these two commands after you copy a file for use by somebody else. Only the owner of a file can delete it.

lsattr files
List attributes for the file(s). Not very often used because the most interesting attributes are still not implemented. The attributes can be changed using the chattr command. The attributes are: A (=don't update atime when the file is modified), S (=synchronous updates), a (=append only possible to this file), c (=file compressed on the kernel level, not implemented yet), i (=immutable file), d (=no dump), s (=secure deletion), and u (undeletable, not implemented yet). An interesting usage may be to make a file undeletable even by root (until s/he clears the attribute).

sudo /sbin/shutdown -h now
(as a regular user, I will be prompted for my user password) Run the command "shutdown" (or another command which you have been given permission to run by your system administrator). With sudo, the administrator can give selected users the rights to run selected commands, without handing out the root password. The file /etc/sudoers must be configured to contain something like:
my_login_name my_host_computer_name = /sbin/shutdown

pwck
grpck
(as root, two commands). Verify the integrity of the password and group files.

pwconv
grpconv
(as root) Unlikely you need these commands. They convert old-style password and group files to create the more-secure "shadow" files.

Last edited by mijohnst; 11-23-2005 at 12:59 PM.
 
Old 11-23-2005, 05:50 PM   #9
sleepykit
Member
 
Registered: Sep 2005
Distribution: Mandriva 2007 & Ubuntu Fesity Fawn
Posts: 67

Original Poster
Rep: Reputation: 15
Thank you. That actuallyhelped out a lot.
 
Old 11-23-2005, 05:51 PM   #10
mijohnst
Member
 
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 419

Rep: Reputation: 31
Good!! =)
 
  


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
admin account recovery rajivb Linux - Newbie 4 02-20-2005 02:06 AM
domain admin account ? alris Linux - Networking 0 11-01-2004 08:15 PM
Setting up Admin account on redhat 9 server manny203 Linux - Networking 4 09-06-2003 05:56 PM
mail server user account admin? bejamex Linux - Software 0 06-22-2003 09:59 PM
Resetting Admin Account mcronin Linux - Software 0 07-03-2002 12:29 AM

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

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