Invalid argument with "\" in Linux username (Active Directory user)
Describe the bug
Is Backslash(\) accepted in Linux guest username using vmware tools or open-vm-tools?
VM: A domain (Active Directory) joined Linux VM open-vm-tools version: 2:11.1.5-1~ubuntu20.04.2
The following command works in Linux:
govc guest.getenv -l [email protected]:Password -vm ubuntu-20-vm-1
The following command fails:
govc guest.getenv -l arcvmw\\arcuser:Password -vm ubuntu-20-vm-1
Error: govc: ServerFaultCode: A specified parameter was not correct:
SSH succeeds though:
ssh arcvmw\\arcuser@<ip>
Contents of /var/log/vmware-vmsvc-root.log
[2023-02-21T16:10:55.717Z] [ message] [vix] VixTools_ProcessVixCommand: command 187
[2023-02-21T16:10:55.717Z] [ warning] [VCGA] Username 'arcvmw\arcuser' contains invalid characters
[2023-02-21T16:10:55.718Z] [ warning] [vix] VixToolsImpersonateUser: impersonation failed (3)
[2023-02-21T16:10:55.718Z] [ message] [vix] VixToolsReadEnvVariables: opcode 187 returning 3
[2023-02-21T16:10:55.718Z] [ message] [vix] ToolsDaemonTcloReceiveVixCommand: command 187, additionalError = 2
Reproduction steps
- Join a Linux VM to active directory
- Install latest version of open-vm-tools on the VM
- Try to authenticate to the VM using "domain\user" format ...
Expected behavior
The guest credentials should work.
Additional context
No response
Is Backslash() accepted in Linux guest username using vmware tools or open-vm-tools?
No, it is accepted in Windows usernames that have a domain name, but not in Linux.
See Usercheck_UsernameIsLegal() in https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vgauth/common/usercheck.c.
357 #ifdef _WIN32 358 // allow '' in for Windows domain usernames 359 char *illegalChars = "<>/"; 360 #else 361 char *illegalChars = "\<>/"; 362 #endif
An internal bug has been filed to track this issue.
Hi @dsouders , thanks for looking into this so quickly! I had one follow-up question. Should I open the same issue in the vmware forum for making the same change in the proprietary vmware-tools? If I need to do that, can you provide a suitable link as to where I should post?
Hi @nascarsayan, There's no need for that. The internal bug covers both. Thanks!