I want to change the file owner and group of root:root to usr1.
If you run sudo chmod usr1:usr1file
to change the username and group name on wsl2, you cannot change it with the chmod:invalid mode:'usr1:usr1'
error.
Install by wsl--install-d Ubuntu
with PowerShell administrator privileges.
PSC:\Users\admin>wsl-l-v
NAME STATE VERSION
* Ubuntu Running 2
Operation at Ubuntu terminal
:
Enter new UNIX username—usr1
:
usr1@pc:~$ sudo su-
root@pc:~#cd../home/usr1
root@pc:/home/usr1#echoabc>file
root@pc:/home/usr1#exit
usr1@pc:~$ls-l
-rw -r --r -- 1 root root 4 Dec 421:49 file
usr1@pc:~$sudo chmod777file
usr1@pc:~$ls-l
- rwxrwxrwx1 root root4 Dec 421:49 file
usr1@pc:~$sudo chmod usr1:usr1 file
chmod: invalid mode: 'usr1:usr1'
Try'chmod --help' for more information
The symptom is the same no matter how many times you uninstall and reinstall Ubuntu.
I think there is a wrong operation.
Thank you for pointing it out.
Windows 10 Pro 22H2 Windows 11 Home 22H2 ※ Both symptoms are the same.
ubuntu windows-10 wsl-2
© 2024 OneMinuteCode. All rights reserved.