VMware Cloud Community
rainbowj
Contributor
Contributor

how to check root expire information of VCSA

Currently, I am working on a project to upload a file to VCSA  with root account using this api “makeDirectoryInGuest”, but it is fail to connect. The root cause is my root account is expired. So I want to find a API to check if the account is expired or get root expire information( such as expire date). I find ValidateCredentialsInGuest api can be used to do authority, but it will return the same exception if the password is expired or incorrect password, and I can not distinguish them. Does anyone help to guide which api should I use to get root expired information.

0 Kudos
4 Replies
rajen450m
Hot Shot
Hot Shot

Hi,

Try to reset the password using the below KB and set it to 0 in administration afterwards.

VMware Knowledge Base

Login to your VCSA and navigate to Administration to find the password expiry details and change it to 0 days to never expire.

pastedImage_0.png

Regards,

Raj M Please mark helpful or correct if my answer resolved your issue. Visit www.hypervmwarecloud.com for my blog posts, step-by-step procedures etc.,
0 Kudos
rainbowj
Contributor
Contributor

Thanks for you information, I know where to reset it or change expire rule.

But I am using the code(script) to upload file to VCSA with root account, so before I do upload action, I should check if the root account has expired or not? If it is expired, my code should popup message like "root account is expired, please reset or change it ". So my question is that if  there is an API to get expire information or validate if root is expired?

0 Kudos
rajen450m
Hot Shot
Hot Shot

i'm not sure about any API to check something like that. As far as I know, pyvmomi can be used to create users.

Please try to login to VCSA with your current root account, it tells whether it is expired or not.

Regards,

Raj M Please mark helpful or correct if my answer resolved your issue. Visit www.hypervmwarecloud.com for my blog posts, step-by-step procedures etc.,
0 Kudos
Vijay2027
Expert
Expert

"chage -l root" command will give you information related to password expiration

0 Kudos