Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange results using useradd command

Status
Not open for further replies.

stevenriz

IS-IT--Management
May 21, 2001
1,069
I have used this command in the past to add users...
useradd -u 1224 -g 80 -d /opt/home/username -mk /opt/home/ username

but now when I run it, it created the user directory but seems to want to copy the contents of another user's directory into this one. I have to break out of it because this other user's directory has a ton of stuff in it.

what gives? I swear this is the syntax I use usually....

Steve
 
Let me add this. When I break out of it, here is the error I receive....

useradd: ERROR: Unable to copy skeleton directory into home directory: No such file or directory.

Does this help?
 
I think I figured it out. When using the -k param, it uses the /opt/home/* as the skeleton directory. Therefore it would have copied the entire directory structure of all the users if I let it. I noticed that the user it was copying happened to have the lowest UID and that is probably why it was copying that user's data first. Let me know what your thoughts are. I think I am right though.

Steve
 
Generally speaking, you'll want to load up the /etc/skel directory with the default set of files and use that with the useradd command. Not required of course, but that's the reason it's there.

--
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top