@Leojangh Apologies for the delay in response and all the inconvenience caused because of the issue.
Changing a users uid affects its ability to ssh and is not recommended as a best practice. Do not edit /etc/passwd file by hand or using a text editor such as vi. This explains how to change or rename username in Linux using the usermod command.
As per mentioned in the article you might need to change the entry in password files and then remove their home folded of the user and need to change password of the user. Now since the key pair is stored under the user profile you will need to do the key pair copy again since you wont be able to use the old ssh key pair.
You can use ssh-copy-id command for same. Once done you should be able to SSH to your VM.
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.
Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as convenient to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.