VMware Cloud Community
jcouch
Enthusiast
Enthusiast
Jump to solution

/usr/bin/useradd deprecated - vim-cmd replacement

Developing an esxi5 build and noticed that  "usr/bin/useradd -M -s /sbin/nologin user" no longer works. It says to use the vim-cmd command.

Does anyone know what that command might be?

Thanks,

Jeff

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
tomtom901
Commander
Commander
Jump to solution

Just because it isn't in the $PATH, doesn't mean that it isn't there. adduser is now located in:

~ # /usr/lib/vmware/auth/bin/adduser

BusyBox v1.20.2 (2012-12-11 11:54:28 PST) multi-call binary.

Usage: adduser [OPTIONS] USER

Add a user

  -h DIR Home directory

  -g GECOS GECOS field

  -s SHELL Login shell

  -G GRP Add user to existing group

  -S Create a system user

  -D Don't assign a password

  -H Don't create home directory

  -u UID User id

I was able to create a local user, login via the vSphere client successfully and add permissions which worked like a charm. Confirmed on 5.1 (1312873) and 5.5 (1331820)

Hope this helps,

View solution in original post

Reply
0 Kudos
5 Replies
lamw
Community Manager
Community Manager
Jump to solution

Hi Jeff,

I'm not aware of a way to create users using vim-cmd, you definitely can using vSphere Client but from a scripted installed, you can still use the useradd command and if you run the command "useradd -M -s /sbin/nolong user", it will actually still add the user.

What you can use vim-cmd is to create custom roles or assign permissions to a user:

~ # vim-cmd vimsvc/auth
Commands available under vimsvc/auth/:
entity_permission_add     lockdown_mode_enter       role_permissions
entity_permission_remove  lockdown_mode_exit        role_remove
entity_permissions        permissions               roles
lockdown_is_enabled       privileges
lockdown_is_possible      role_add

You can always update /etc/passwd, /etc/shadow and /etc/group entries which is another way adding users as long as you have the needed entries.

Here are two articles that might be helpful with regards to user/role management on ESXi for scripted installs:

http://www.virtuallyghetto.com/2011/06/how-to-create-custom-roles-on.html

http://www.virtuallyghetto.com/2011/05/cim-monitoring-caveat-with-esxi.html

markdjones82
Expert
Expert
Jump to solution

Did anyone find an answer to this?  I need to get a local user created as well because of a requirement by ECC.

The other thing I noticed is even with the useradd command I cannot pass the password in the useradd command.  It isn't even an option.

http://www.twitter.com/markdjones82 | http://nutzandbolts.wordpress.com
Reply
0 Kudos
jcouch
Enthusiast
Enthusiast
Jump to solution

Hey William, Sorry i never closed this out last year.  This worked with 5.0 u2 and all was well. Now we are deploying 5.1 u1 and I'm developing the build again and the useradd command is gone. Do you have any suggestions on how to create local accounts during the firstboot on a kickstart for 5.1?

Reply
0 Kudos
tomtom901
Commander
Commander
Jump to solution

Just because it isn't in the $PATH, doesn't mean that it isn't there. adduser is now located in:

~ # /usr/lib/vmware/auth/bin/adduser

BusyBox v1.20.2 (2012-12-11 11:54:28 PST) multi-call binary.

Usage: adduser [OPTIONS] USER

Add a user

  -h DIR Home directory

  -g GECOS GECOS field

  -s SHELL Login shell

  -G GRP Add user to existing group

  -S Create a system user

  -D Don't assign a password

  -H Don't create home directory

  -u UID User id

I was able to create a local user, login via the vSphere client successfully and add permissions which worked like a charm. Confirmed on 5.1 (1312873) and 5.5 (1331820)

Hope this helps,

Reply
0 Kudos
jcouch
Enthusiast
Enthusiast
Jump to solution

That's exactly what i was looking for. Thanks!

Reply
0 Kudos