Operating System - HP-UX
1827647 Members
3130 Online
109966 Solutions
New Discussion

Useradd fails with /home/common is not a valid directory

 
Henry Weldon
Advisor

Useradd fails with /home/common is not a valid directory

I have 200 user accounts with a common directory. When I attemted to create 201, it fails saying the directory does not exist. This is of course not the case. 200 other accounts share the directory with no problem. Is there some limit on the number of user accounts that can share a common directory?
Be Prepared
2 REPLIES 2
Shannon Petry
Honored Contributor

Re: Useradd fails with /home/common is not a valid directory

If your going to do something as crazy as this, then it is best NOT to use standard tools to make modifications! My guess (from seeing these setup's before) is that all users share UID# and group. Sorry to assume, but somethings rarely change....

standard tools look at things from the standard perspective.

1. UID must be unique
2. GID must exist
3. user name can not already exist
4. shell must exist
Depending on what your doing the home may or may not be checked for existance.

The only way you can be having 200 users share a home is to have either 777 permissions on the home, and/or more than likely sharing the same UID number.

These things all cause problems!
I.E. User1's shell history being overwritten by User2 because the default history goes into $HOME. Users can delete each others data command line by overriding the not owner error. Display errors and lots of errors from any of the many getuser() functions. Also finger and identd snafu's!

Your best bet is to either write your own script to find unique numbers, and create the ID, or use an editor to manually create them.

Regards,
Shannon
Microsoft. When do you want a virus today?
James R. Ferguson
Acclaimed Contributor

Re: Useradd fails with /home/common is not a valid directory

Hi Henry:

What is the returnvalue from 'useradd'? The /etc/group file has a line length limitation of (LINE_MAX - 50)/9. On my systems LINE_MAX is 2048 as defined in /usr/include/limits.h Thus, my limit per group would be somewhere around 222. Do you in fact have other accounts belonging to the same group and are thus reaching this limit?

...JRF...