1822231 Members
3596 Online
109642 Solutions
New Discussion юеВ

useradd problem

 
SOLVED
Go to solution
Sunny Jaisinghani
Trusted Contributor

useradd problem

Hello All,

I have faced an unusual behaviour while creating a user on a HPUX box.

I tried creating user account through command line as well as sam, the user got created but it gave an error that "cannot create the home directory"

when i checked the home directory was created but the files contained in the home directory
is owned by some other non existing user...

See the output below....

# ls -alt /home/a128646
total 10
drwxr-xr-x 2 us06439 users 96 Nov 29 20:56 .
-r--r--r-- 1 us06439 users 832 Nov 29 20:56 .cshrc
-r--r--r-- 1 us06439 users 347 Nov 29 20:56 .exrc
-r--r--r-- 1 us06439 users 334 Nov 29 20:56 .login
-r--r--r-- 1 us06439 users 439 Nov 29 20:56 .profile

Regards
5 REPLIES 5
Sunny Jaisinghani
Trusted Contributor

Re: useradd problem

one more example....

# ls -alt /home/a118014
total 16

-rw------- 1 126 users 1222 Nov 29 05:17 .sh_history
drwxr-xr-x 2 126 users 1024 Nov 6 20:03 .
-r--r--r-- 1 126 users 832 Oct 14 03:40 .cshrc
-r--r--r-- 1 126 users 347 Oct 14 03:40 .exrc
-r--r--r-- 1 126 users 334 Oct 14 03:40 .login
-r--r--r-- 1 126 users 439 Oct 14 03:40 .profile


the user 126 is not there in /etc/passwd
Kapil Jha
Honored Contributor

Re: useradd problem

Starnge
delete these users and recreate using command line.Check etc/passwd file
post out the command.....
BR,
Kapil
I am in this small bowl, I wane see the real world......
Sunny Jaisinghani
Trusted Contributor

Re: useradd problem

I tried recreating the users after deleting them... however being the root user i was not able to delete the home directory.. strange!!!!!!!

# userdel -r a128646
rm: .cshrc not removed. Permission denied
rm: .exrc not removed. Permission denied
rm: .login not removed. Permission denied
rm: .profile not removed. Permission denied
rm: directory /home/a128646 not removed. Permission denied
Cannot delete home directory


after recreating the same thing happenened
i used

userdel -m -d /home/a128646 -s /usr/bin/ksh -c "-----" a128646
MarkSyder
Honored Contributor
Solution

Re: useradd problem

Is the home directory an NFS mount? If so, the non-existent user is almost certainly a user on the other server. You will probably find that that user has the same uid on that server as your new user on your server.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Sunny Jaisinghani
Trusted Contributor

Re: useradd problem

Thanks Mark.

The /home directory was Network file system.

Regards