VMware Cloud Community
mfiedler
Contributor
Contributor

Resetting a local account password

I have a bunch of ESX Hosts that have a local user account on them - let's call it v-local.

When I run: Get-VC to connect, then: Get-VMHost | Get-VMHostAccount -Name v-local --> Error

I am guessing that this is because the user is not actually stored in the VC - but locally on the ESX host.

I can accomplish querying each vmhost via:

Connect-VIServer -Server vmhost1,vmhost2,....etc

Get-VMHostAccount -User v-local --> success.

Now I'd like to reset the password for v-local but I noticed that when I run: Set-VMHostAccount -User v-local -Password newpass - this succeeds, but it also changes the /etc/passwd entry from /bin/bash to /bin/false, effectively locking that user out.

Any ideas on how to: 1. Set passwords on local accounts via VC connection; 2. Make sure I don't get locked out?

Thanks!

0 Kudos
2 Replies
admin
Immortal
Immortal

Hi,

You do need to connect directly to ESX for this sort of thing, it's a quirk of the underlying API.

We know about the brokenness with Set-VMHostAccount and will be fixing that. Consider this workaroundin the meantime. You'll have to tweak this a bit to use UpdateUser rather than CreateUser.

mfiedler
Contributor
Contributor

This seems to have been fixed in the newer version, per release notes.

Use that, and it should be fine.

0 Kudos