Operating System - HP-UX
1846539 Members
2325 Online
110256 Solutions
New Discussion

Re: usermod error message

 
SOLVED
Go to solution
RJA
Advisor

usermod error message

Hi, trying to change a users home directory using usermod.

usermod -d /home/x12345 x12345

The following error message is returned.

'/home/x12345' is not a valid directory


The /home/x12345 directoy exists and is owned by x12345.

Why does this error occurr?
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor
Solution

Re: usermod error message

Hi:

Perhaps you want to *move* the home directory:

# usermod -md /home/x12345 x12345

Regards!

...JRF...
RJA
Advisor

Re: usermod error message

No, we don't want to move it, just change it to /home/x12345.
David Child_1
Honored Contributor

Re: usermod error message

What are the permissions of the target directory? You may get this error if permissions for the group are not read/exec. The group should also be the primary group for x12345.

David
RJA
Advisor

Re: usermod error message

Permissions on /home/x12345 are 755. directory is owned by x12345:users
Dennis Handly
Acclaimed Contributor

Re: usermod error message

If you don't figure out why usermod(1m) fails, you can always use vipw(1m), if your system isn't trusted.
kumar_10
New Member

Re: usermod error message

Dear RJA, Please try & confirm

1, Remove the directory you have made

You have to run the command without creating any dirctory

2, #usermod -d /home/x12345 username

Which will create the home directory (x12345) with proper permission /ownership and update the same in passwd file. Then you can mv the scripts and other files from the old home directory.

Kumar
RJA
Advisor

Re: usermod error message

kumar's suggestion worked. Thanks all for looking at it...

RJA
Advisor

Re: usermod error message

Thanks all..
Court Campbell
Honored Contributor

Re: usermod error message

You could have just edited /etc/passwd directly after creating the users new home directory.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"