LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-12-2007, 04:00 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Rep: Reputation: 17
Question User Creation in Linux


Hi

I want to create one Normal user who can create user,mod user,del user but he can not change root password, I have configured sudo but problem is same , I dont want user can change root password
 
Old 09-12-2007, 04:57 AM   #2
SlackerLX
Senior Member
 
Registered: Dec 2004
Location: Herzliyya, Israel
Distribution: SuSE 10.1; Testing Distros
Posts: 1,832

Rep: Reputation: 47
Quote:
Originally Posted by manoj.linux View Post
Hi

I want to create one Normal user who can create user,mod user,del user but he can not change root password, I have configured sudo but problem is same , I dont want user can change root password
To create a new account manually, follow these steps:


Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor! vipw locks the file, so that other commands won't try to update it at the same time. You should make the password field be `*', so that it is impossible to log in.


Similarly, edit /etc/group with vigr, if you need to create a new group as well.


Create the home directory of the user with mkdir.


Copy the files from /etc/skel to the new home directory.


Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

Code:
 cd /home/newusername
      chown -R username.group .
      chmod -R go=u,go-w .
      chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

Also see this page:
http://www.yolinux.com/TUTORIALS/Lin...ingGroups.html

Last edited by SlackerLX; 09-12-2007 at 05:00 AM. Reason: Edit
 
Old 09-12-2007, 05:44 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
How did you configure sudo. You can have these commands explicitly included in /etc/sudoers. This will allow you to delegate permissions to run these programs without giving them the root password or allowing the use of su. However the usermod program allows a user to change a password with the -p option. So either you need to choose someone you can trust or don't delegate the right to use usermod.

I may have missed something with usermod, such as PAM which might be used in the process.
Also download the source package for your distro. Check if any build options can remove the -P option or afford protection against modifying the root account. Running "./configure --help" usually supplies this information.
 
  


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
System user creation with mysql user creation moos3 Programming 1 08-11-2007 08:01 PM
User Creation Script mfaisalkh Programming 1 08-06-2007 03:57 AM
Webmin and User creation droz578 Linux - Security 1 01-13-2005 03:43 AM
Automatic user creation Skorpio Linux - Networking 3 09-25-2003 10:45 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 08:57 PM.

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