Windows 10 Linux Subsystem How to Change User Name and PC Name for Bash Console
According to therobyouknow's comment, LxRun.exe
is deprecated now.
Please refer to Mitchell Van Manen's answer if you're using the new version of subsystem.
====================================================================
You should use LxRun.exe
command locating in C:\WINDOWS\system32
.
Here are two solutions, which are all run in cmd.exe
instead of bash
.
Use the command below to create a new user and set it as the default user:
LxRun.exe /setdefaultuser NEW_USER
OR Uninstall Linux subsystem fully and reinstall it
LxRun.exe /uninstall /full LxRun.exe /install
The next time you reenter bash, it will prompt you to input username.
In the new version of the subsystem, the command is (from elevated cmd.exe):
C:\> ubuntu run sudo usermod -l newUsername oldUsername
this way you will circumvent logging in with the old username first.
Article thread.
You have to create a ssh_config and put your username into it. The location within the Windows Linux Subsystem is /mnt/%windir%/windows
Create ~/.ssh/config
file and name write your username inside the file like:
user New_User_Name
You do not have to worry about permissions.