Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-10-2006, 10:50 AM   #1
Kjell Persson
LQ Newbie
Registered: Feb 2006
Posts: 7

Rep: Reputation: 0
Addin New User in Linux

I added a new user as follows, Is this the correct commands to do that?

useradd goofy
passwd goofypass
expire_date 2006-12-01
home_dir /home/goofyhome

Now I need to be able to get goofy's line from the LInux passwd file and output it to a new file called goofy_passwd in goofy's home directory.

do I need to use the mv command or how can I do it?
I have dearch the man files but am totally confused.

Please, please I need help.


Old 02-10-2006, 11:39 AM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You fail to mention your distribution name (Use the MyLQ button at the top of the screen to set the information you should have entered when you registered.) but, for what it's worth, on Fedora you'd use the system-config-users command to add a user.

In any case, you should never, ever, have a password file in a user directory. Even encrypted that represents an unnecessary security hole.
Old 02-10-2006, 12:49 PM   #3
Registered: Aug 2003
Location: Melbourne Australia
Distribution: Fedora Core 4
Posts: 184

Rep: Reputation: 30
This is a strange request!

As for the first part of your question, the way you have structured the commands looks very odd! Is this exactly how you typed them into your terminal, one per line? If so then you would have seen errors galore! You need to have them all on the same line & use the correct argument (option) instead of the name of the argument. For example, the following line is the correct way of issuing that command :

useradd goofy -p goofypass -e 2006-12-01 -d /home/goofyhome

When you read a man page, the arguments are the letters with the "-" before it & the underlined word that follows means that this particular argument requires a value. For example, in the man page for useradd, the line :

-e expire_date
The date on which the user account will be disabled. The date
is specified in the format YYYY-MM-DD.

means that if you would like to specify a date when the user account will be disabled then you add the argument "-e" to the command line followed by the date you would like it to become disabled in the format specified (YYYY-MM-DD) Almost all man pages follow this format.

If you did not already know what I have just explained then you are obviously extremely new to Linux, if this is the case then you really should read through a "Getting Started" tutorial that is aimed at the distribution that you are using. There are thousands of them out there & they are very easy to find, simply google for "linux basics tutorial" & also add the name of your distribution to narrow down the search.

The next part of your question has got me stumped! Why do you want to have a users password file in his home directory? As PTrenholme mentioned this is very insecure, not to mention unnecessary! Simply getting that data into a new file is actually quite simple to do, but to force Linux to use this file to check goofy's password at login is a little more complex. Why do you want to do this? You really shouldn't!


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
Addin a shortcut abulafiar Red Hat 1 09-02-2004 02:53 PM
Map WXP user to Linux user in Samba? Worstje Linux - Software 1 03-26-2004 07:50 PM
Postfix email user & linux user question. hct224 Linux - Newbie 0 11-30-2003 12:24 AM
messed up addin IPs DigiCrime Linux - Networking 19 08-29-2003 11:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration