You can add users to your Azure virtual machine by using the Remote Desktop Protocol (RDP) or the Azure portal.
Using Remote Desktop Protocol (RDP)
- Connect to your VM: Open the Remote Desktop Connection application on your local computer and enter the public IP address of your Azure VM.
- Log in with administrator credentials: Use the username and password for the administrator account on your VM.
- Open the "Computer Management" console: Once logged in, search for "Computer Management" and open the console.
- Navigate to "Local Users and Groups": Under the "Computer Management" console, navigate to "Local Users and Groups."
- Create a new user account: Right-click on "Users" and select "New User."
- Enter user details: Provide a username, password, and any other necessary information for the new user.
- Confirm and create: Click "Create" to finish creating the new user account.
Using the Azure Portal
- Navigate to your VM: Log in to the Azure portal and navigate to the resource group containing your VM.
- Access VM settings: Select your VM and click on "Settings."
- Choose "Access control (IAM):" Under the "Settings" menu, select "Access control (IAM)."
- Add a new role assignment: Click on "Add" and select the role you want to assign to the user.
- Select the user: Choose the user you want to add to your VM from the list of users.
- Save the changes: Click on "Save" to apply the changes.
Note: Using the Azure portal allows you to assign specific roles and permissions to users, providing more granular control over user access to your VM.
Examples:
- You can add a new user to your VM and assign them the "Contributor" role, giving them full access to manage the VM.
- You can create a new user and assign them the "Reader" role, allowing them to view the VM but not make any changes.