How to use the command 'qm guest passwd' (with examples)

How to use the command 'qm guest passwd' (with examples)

This article provides examples of using the command ‘qm guest passwd’ in QEMU/KVM Virtual Machine Manager.

Use case 1: Set a password for a specific user in a virtual machine interactively

Code:

qm guest passwd vm_id username

Motivation: The motivation for using this use case is to set a password for a specific user in a virtual machine when the exact password is known.

Explanation:

  • ‘qm guest passwd’: This is the command to set the password for a specific user in a virtual machine.
  • ‘vm_id’: This is the ID of the virtual machine for which the password needs to be set.
  • ‘username’: This is the username for which the password needs to be set.

Example output:

Enter new guest password for user 'username': 
Confirm password: 
Password changed successfully for user 'username' in virtual machine 'vm_id'.

Use case 2: Set an already hashed password for a specific user in a virtual machine interactively

Code:

qm guest passwd vm_id username --crypted 1

Motivation: The motivation for using this use case is to set an already hashed password for a specific user in a virtual machine.

Explanation:

  • ‘qm guest passwd’: This is the command to set the password for a specific user in a virtual machine.
  • ‘vm_id’: This is the ID of the virtual machine for which the password needs to be set.
  • ‘username’: This is the username for which the password needs to be set.
  • ‘–crypted 1’: This argument indicates that the password provided is already hashed.

Example output:

Enter hashed guest password for user 'username': 
Password changed successfully for user 'username' in virtual machine 'vm_id'.

Conclusion:

The ‘qm guest passwd’ command is useful for setting passwords for specific users in virtual machines managed by QEMU/KVM Virtual Machine Manager. It provides the flexibility to set passwords interactively or with already hashed passwords.

Related Posts

How to use the command 'git tag' (with examples)

How to use the command 'git tag' (with examples)

The git tag command is used to create, list, delete, or verify tags in Git.

Read More
How to use the command mate-dictionary (with examples)

How to use the command mate-dictionary (with examples)

This article will illustrate the use cases of the command mate-dictionary, which is used to look up words in dictionaries.

Read More
How to use the command xonsh (with examples)

How to use the command xonsh (with examples)

Xonsh is a Python-powered, cross-platform, Unix-gazing shell. It allows users to write and mix sh/Python code in the Xonsh shell, providing a powerful and flexible environment for shell scripting and interactive shell sessions.

Read More