Highlighted
Contributor
Contributor

Issues adding & modifying users in esxi

Hi

I am facing couple issues with adding new administrative users in esxi

I used the useradd command to add the user but it seems like the user is not getting added to the root group

useradd -d /home/$ADMIN_USER -c $USER_DESCRIPTION -s /bin/ash -g "root" -n $ADMIN_USER

I used the groupadd which worked. Is this the expected sequence or am i missing something in useradd?

Second issue is for the new user if I use vSphere to modify the password, the shell "/bin/ash" is replaced by ''/sbin/nologin" and I can no longer log into the shell.

Am I supposed to specify some additional options when I create the user to ensure this is preserverd.

Thanks

0 Kudos
3 Replies
Highlighted
Enthusiast
Enthusiast

Hi

# useradd -d / -c "Test User" -s /bin/ash -n -g root -P -M usrtest
# cat /etc/passwd | grep -i usrtest
usrtest:x:507:100:Test User:/:/bin/ash
# /usr/sbin/usermod -g root usrtest
# /usr/sbin/usermod -G root usrtest
# cat /etc/passwd | grep -i usrtest
usrtest:x:507:0:Test User:/:/bin/ash
# cat /etc/group | grep -i root
root:x:0:root,usrtest
------------- http://communities.vmware.com/blogs/Deshifrator
Highlighted
Contributor
Contributor

Thanks for your reply.

groupadd seems to accomplish the adding to group as well so I assume just useradd alone is not sufficient.

This still does not resolve the issue of the shell for the new user changing to /sbin/nologin on restart

0 Kudos
Highlighted
Enthusiast
Enthusiast

Your problem in the Knowledge Base:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=102917...

KB Article: 1029178

------------- http://communities.vmware.com/blogs/Deshifrator
0 Kudos