Azure-cli: List the current OS users of Linux VM

Created on 25 Mar 2019  路  4Comments  路  Source: Azure/azure-cli

Hi,

I want to add the multiple users on my Linux VM on Azure cloud, i could find the instruction on https://docs.microsoft.com/en-us/cli/azure/vm/user?view=azure-cli-latest, however strangely enough there's no such command to list the current OS users.

My requirement is to create and delete users, hence, i would like to pull the list of existing OS users and then perform some comparison before deleting or updating them.

Any help in this regard would be highly appreciated.

Thanks,

Compute-cli question

All 4 comments

I don't believe this information is returned by the service, but I'll defer to @adewaleo for further clarification.

There is no Azure API to give you the list, rather you have to do it through linux commands executed in the VM. For scripting, you can consider ssh [email protected] 'cat /etc/passwd' if the credentials used by SSH are pre-configured in the client machine

Closing as this is a by-design

Thanks @yugangw-msft @tjprescott . I was going to look into this, which was why I hadn't responded

Was this page helpful?
0 / 5 - 0 ratings