LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 08-05-2008, 05:32 AM   #1
Tim356
LQ Newbie
 
Registered: May 2006
Distribution: RHEL 5.2
Posts: 27
Thanked: 0
Manually adding users and the shadow file...


[Log in to get rid of this advertisement]
Adding a user manually to the /etc/passwd file, by tacking on this line:

Code:
testuser:x:500:500:Test User:/home/testuser:/bin/bash
then saving, I get this:
Code:
[root@localhost ~]# vipw
You are using shadow passwords on this system.
Would you like to edit /etc/shadow now [y/n]?
Now, if I enter y, I get taken to the shadow file, obviously. What should I enter here?? If I just enter a random password string such as this line:
Code:
testuser:asdfweusljasdfunwdfsasasf
First I have to force it to write to a readonly file, then when I do the following, I get an error.
Code:
[root@localhost ~]# passwd testuser
Changing password for user testuser.
passwd: Authentication token manipulation error
How am I actually meant to do this? I know I can do this with useradd and through x, but how can I manually do it?
Tim356 is offline  
Tag This Post , ,
Reply With Quote
Old 08-05-2008, 06:30 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Kubuntu 8.04 32 bit and 64 bit, PCLOS 2009
Posts: 2,665
Thanked: 50
Instead of editing the shadow file you can use the pwconv utility.
Code:
pwconv
That utility will reconcile all of the user accounts listed in the passwd file with the shadow file entries. Then you can use the passwd utility to create a passwd for the new user account.
stress_junkie is offline     Reply With Quote
Old 08-05-2008, 06:46 AM   #3
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,881
Thanked: 232
Use the useradd program instead to add a new user. That's what its there for.
jschiwal is offline     Reply With Quote
Old 08-05-2008, 07:00 AM   #4
Tim356
LQ Newbie
 
Registered: May 2006
Distribution: RHEL 5.2
Posts: 27
Thanked: 0

Original Poster
Quote:
Originally Posted by stress_junkie View Post
Instead of editing the shadow file you can use the pwconv utility.
Code:
pwconv
That utility will reconcile all of the user accounts listed in the passwd file with the shadow file entries. Then you can use the passwd utility to create a passwd for the new user account.
Cheers! That did the trick. Thanks for helping.


jschiwal: you might notice in my first post that I mentioned this:
Quote:
I know I can do this with useradd and through x, but...
Tim356 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Adding users from file using PERL? happy13 Programming 3 12-22-2007 08:26 PM
manually adding rules w/ firestarter installed jonfa Linux - Security 1 03-11-2007 01:34 PM
/etc/shadow and local users deepclutch Linux - Software 2 12-22-2005 11:29 PM
Users unable to use crontab unless in /etc/shadow atnan Linux - General 2 05-04-2005 12:43 AM
Help on Administrative Utility (adding users & data from input file) NightWolf_NZ Linux - Software 0 09-10-2003 09:43 PM


All times are GMT -5. The time now is 05:49 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration