Operating System - HP-UX
1820733 Members
3240 Online
109627 Solutions
New Discussion юеВ

useradd returns not a valid directory

 
Nate Arnold
Frequent Advisor

useradd returns not a valid directory

Greetings,

I am trying to add number of users to a few of my servers via a script. This script has worked in the past with other home directories but I get the following error when I run the attached command: "'/home/app/' is not a valid directory"

useradd -d /home/app/ -u 511 -c Amy_Whipple -s /usr/bin/ksh -g epic -G epicgrp ahiwpple

This directory has been in production use for 4 years and current users have no problem using it today.

Any thoughts?

Thanks
5 REPLIES 5
John Dvorchak
Honored Contributor

Re: useradd returns not a valid directory

In your command I don't see the -m switch to create the directory. I also am not sure about the -d selection you have. I thought you had to actually give the full path to the home directory:

useradd -d /home/app/ahiwpple -u 511 -c etc. etc.
I would type the command like this:

useradd -g epic -d /home/app/ahiwpple -m -s /usr/bin/ksh -G epicgrp -c "Amy Whipple" ahiwpple

I am assumeing that the ahipple is a typo and it should actuall be ahwipple.

If it has wheels or a skirt, you can't afford it.
Mel Burslan
Honored Contributor

Re: useradd returns not a valid directory

One thing that comes to mind is if the /home/app an NFS mount point ? If so, are you able to create files on this directory even as root ? When it comes to NFS, you are at the mercy of exported rights on that servers even if you are root on the client side.

If worse comes to worst, can you create a user with the default homedir, i.e., /home/awhipple and edit the passwd file with 'vipw' command and replace the value of homedir and user can still work ?
________________________________
UNIX because I majored in cryptology...
Nate Arnold
Frequent Advisor

Re: useradd returns not a valid directory

I found the problem. Apparently when you use the the -d argument to specify a home directory . The group ID of the directory must be the primary group ID of the user.
Steven E. Protter
Exalted Contributor

Re: useradd returns not a valid directory

See if permissions have gotten messed up on the directory in question.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Nate Arnold
Frequent Advisor

Re: useradd returns not a valid directory

Thanks for the quick ideas but I was able to resolve the problem myself. Please see my comments above for the solution.