Operating System - HP-UX
1836002 Members
5339 Online
110088 Solutions
New Discussion

Unable to create new user ?

 
SOLVED
Go to solution
rveri
Super Advisor

Unable to create new user ?

Hi Experts ,

I am unable to create a new user:

Here is the details:
-------------------

# useradd -u 520 -s/usr/bin/ftpshell -d /interfaces -m -g ftponly XIFTP
'/interfaces' is not a valid directory

I have tried with sam also , but same error.

---------------------------------------------

The directory is present ,still giving error:

# bdf | grep interfaces
/dev/vg04/lvol4 10485760 7629882 2677438 74% /interfaces

# ls -l | grep interfaces
# ls -l | grep interface
drwxrwxrwx 19 dv2adm sapsys 3072 Nov 23 01:33 interfaces
------------------------

System: hp-ux 11i , N Class.

Please help asap.

Thanks.
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: Unable to create new user ?

Interesting that "# ls -l | grep interfaces" returns nothing yet the second grep does. Has anyone else been successfully set up to use this directory?


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Unable to create new user ?

Hi Rveri:

I believe that your problem is the you have specified the '-m' option to enable directory creation.

The man pages note that "-m Creates the home directory for the new login if it does not exist. If the home directory exists, the directory must have read and execute permission by group, where group is the primary group of the new login. The -m option must be used to create a home directory."

It appears the group of the user that you are trying to create does not match that of the directory.

Regards!

...JRF...
rveri
Super Advisor

Re: Unable to create new user ?

sorry Pete,

Thats s pasting mistake ,


Here it is again :

# ls -l | grep interfaces
drwxrwxrwx 19 dv2adm sapsys 3072 Nov 23 01:33 interfaces

Pls suggest.


rveri
Super Advisor

Re: Unable to create new user ?

Hi JRF ,



Also if the directory is a automounter or NFS mounted FS , can I able to create a user specifying that directory as a home dir.

thanks
James R. Ferguson
Acclaimed Contributor
Solution

Re: Unable to create new user ?

Hi (again) Rveri:

I urge you to look at the 'useradd(1M)' manpages. It is noted that with NFS, "Errors may occur with the -m or -k options if the indicated directory is within an NFS mounted file system that does not allow root privileges across the NFS mount, and the directory or files within the directory do not have sufficient permissions."

I also urge you to echo the return status of any failed command in situations like this. Together with the manpage documentation you can best identify the exact reason for failure.

http://docs.hp.com/en/B2355-60127/useradd.1M.html

Regards!

...JRF...
rveri
Super Advisor

Re: Unable to create new user ?

Hi JRF ,

Thx for the quick post .

Its a local filesystem only.

# bdf -l | grep interfaces
/dev/vg04/lvol4 10485760 7629882 2677438 74% /interfaces


Also I am now able to create the user , with this command :

# useradd -u 520 -s/usr/bin/ftpshell -d /interfaces -g sapsys XIFTP

And now trying to change the primary group , to ftponly , and getting this error:

# usermod -g ftponly XIFTP
Cannot modify user 'XIFTP': Home directory '/interfaces' is shared


I doubt if permission 777 to the dir , is causing problem.

pls suggest.
Thanks.
Raj D.
Honored Contributor

Re: Unable to create new user ?

Hi veri,

You can try this command instead , to add the group:

# usermod -G ftponly XIFTP

and hope it will not give the error and it will work.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
James R. Ferguson
Acclaimed Contributor

Re: Unable to create new user ?

Hi Rveri:

Again, have a look at the manpages, this time for 'usermod(1M)'. Try a directory permission of 775.

Regards!

...JRF...
rveri
Super Advisor

Re: Unable to create new user ?

Able to do the task with -G option.
Thanks all.