LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2004, 12:38 PM   #1
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Rep: Reputation: 15
Add a user


I got mandrake 9.1 and when i go to mandrake control center>SYstem>Users and when i click users i see this:
Cannot lock use lib,
file/etc/ptmp or /etc/gtmp exist
 
Old 12-03-2004, 12:44 PM   #2
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Did you try this as root?

If all else fails, you can always try the useradd command as root. For info on useradd, try

man useradd

it'll tell you what you can do and how...

Good luck
 
Old 12-04-2004, 06:40 AM   #3
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
i trid as root in the command line by writing userad or add user but getting the same windows when writing enter
 
Old 12-05-2004, 07:29 AM   #4
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
could you please answer?
 
Old 12-05-2004, 12:43 PM   #5
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Not 100% sure I understand the problem here, but I'll try to help.

First, try entering this command as root:

# useradd -g users -d /home/test test

if that works, it will create the user test, and this user will get a new home directory - /home/test. Now, you can remove that user with the following...

# userdel test

<edit>
sorry, forgot to mention that the new user's primary group in this example will be the "users" group. To change the group for the user, change the part after the "-g" in the command. To change the user's name, change the very LAST word in the command (test in this example) to whatever you want the user's name to be. Then change the firectory after /home/ to whatever you want the new user's home directory to be, and it will create that directory for you.
</edit>


If these give you "command not found" it means you need to enter them like this...

# /usr/sbin/useradd -g users -d /home/test test

# /usr/sbin/userdel test

NOw, keep in mind that you don't type the "#" symbol at the beginning of those commands, that just means you are entering them as root.

Let me know if you have any more problems...and good luck!

Jeff

Last edited by jeffreybluml; 12-05-2004 at 12:50 PM.
 
Old 12-05-2004, 04:19 PM   #6
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
I would try to check them and tell you!
 
Old 12-06-2004, 09:07 AM   #7
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
hey at the first command (useradd0 i get command not found when i try the second way i get:
vipw lockfile (/etc/ptmp) is present!
 
Old 12-06-2004, 09:13 AM   #8
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
hmmmm....

try this...

rm -f /etc/ptmp

and then re-try the command. I think we've got a stale file laying around that shouldn't be there....

Let us know if that fixes it for you...
 
Old 12-06-2004, 09:29 AM   #9
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
I writed this command and din't get any respond, the password should be test?
/usr/sbin/useradd -g users -d /home/test test
thanks?

wher can i see if the new user is created
 
Old 12-06-2004, 09:50 AM   #10
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Nope, that user wont have a password yet. To see if the user got created, do:

su test

and if it doesn't give you an error, it'll mean you've just changed to the test user. To get back, just do

exit

and that'll close out that user's session. If that worked, you're all set and can create whatever user you'd like. To set the password while you're creating the user, it'll look like this...

/usr/sbin/useradd -g users -d /home/test -p blah_blah test

that will make the new user's password blah_blah.

Oh, and to delete the user "test" - or any other user - do:

userdel test

and it's gone.

Good luck,
 
Old 12-06-2004, 01:43 PM   #11
cogeek
Member
 
Registered: Aug 2004
Location: Greece
Distribution: Mandrake 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
USER CREATED i would like to say a thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 02:14 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 02:08 AM
How to Enable User or Add New User omeryasin Linux - Software 3 10-29-2005 06:16 AM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 10:59 AM
add user rstmn957 Slackware 5 09-09-2003 01:49 PM


All times are GMT -5. The time now is 10:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration