user create issue

 
emily_3
Frequent Advisor

user create issue

hello,

I have some doubt regarding create user.

1. I created some user by the command:
# useradd -d /home/user1 -s /usr/bin/ksh -m user1

After that I checked in /etc/passwd, the password area for user1 is "*", if I am not wrong this means no passwd.
But I tried to log in from another server:
# rlogin server -l user1
it asked for passwd and I couldn't access with any keyword.

However if I create this user by sam, there is no such access problem. But the home directory is / instead of /home/user1. Can someone help on this?
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: user create issue

After creating the user via the useradd command, I believe you need to run the passwd command to set the password. When using SAM (without any templates), you need to fill in the home directory box.


Pete

Pete
Peter Nikitka
Honored Contributor

Re: user create issue

Hi,

'useradd' command: create new user
'passwd' command: deal with passwords

These are distinct things from the commands point of view.

In SAM you can easily setup the home directory as well as the standard directory path under which new homes should be created.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Fabio Ettore
Honored Contributor

Re: user create issue

Hi emily,

essentially you can create a user in two ways:

- by command line:
useradd -d /home/user1 -s /usr/bin/ksh -m user1
passwd user1

and assign a password.
You have to assign a password to that user after useradd command. After that you shouldn't have further problems.

- or if you prefer by SAM:
it is interactive and very friendly, between the options when creating the user you should see the HOME directory creation too, it is there that you have to assign an HOME directory for user1.

Let us know if you have problems.

HTH.

Good luck,
Fabio
WISH? IMPROVEMENT!
Ninad_1
Honored Contributor

Re: user create issue

Hi emily,

The * in the passwd file indicates you either you have a shadow file - /etc/shadow (As you may be using shadow software) OR you are having trusted system then passwords will be in encrypted form in file /tcb/files/auth/[1st alphabet of user's id]/[userid].
Thus if user id is abc1 then the file is
/tcb/files/auth/a/abc123

When you say home directory is / instaed of /home/user1 - what do you mean ? Do you mean that there is no /home/user1 directory created or when user logs in he lands into / ?
Check if the dir exists
ls -ld /home/user1
and check if user's home directory has been set to /home/user1 - grep the_userid /etc/passwd

Also as others have already pointed out after creating user using useradd, you need to set password using passwd username from root account.

Regards,
Ninad
emily_3
Frequent Advisor

Re: user create issue

Thanks all of your help.

I understand the issue of creating the user by command is that I didn't create the passwd after that.

But when I use sam last time, I did select the make home directory /home/user1. and after created I checked that the /etc/passwd also have /home/user1 for this user, but actually this directory is not created and after I login by using this user1, it go to / dirctory.
Darrel Louis
Honored Contributor

Re: user create issue

Hi Emily,

Don't know the version you're using but check the following:

PHCO_33142:
( SR:8606430859 CR:JAGaf90305 )
Under certain scenarios, useradd/usermod/userdel are not working as expected.

You can use the passwd -f option to force the user to change his/her passwd at next logon.

Goodluck

Darrel
emily_3
Frequent Advisor

Re: user create issue

Hi,

I couldn't find this patch in my server. And my server is ia64 11.23. Do i need to install this patch? Thanks.



Darrel Louis
Honored Contributor

Re: user create issue

The patch for 11.23 is PHCO_33980:


Darrel