chmod WSL(Bash)不起作用 [英] chmod WSL (Bash) doesn't work

查看:285
本文介绍了chmod WSL(Bash)不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 10上运行bash时,以下简单语法在我SSH到Web服务器时有效,但在退出并位于本地计算机上时无效.它没有给我一个错误,但是我可以看到权限没有改变.我必须检查自己是否已在计算机上设置为管理员.这是错误还是仅仅是本地操作系统是Windows的结果?如果稍后,这使我怀疑在Windows上使用bash的价值是否无法正常执行.

$chmod 644 filename 

解决方案

Amade的答案是正确的,但请注意,该cmd仅在会话范围内有效.如果退出当前的bash,则会丢失设置.

要解决此问题,您需要编辑/etc/wsl.conf.并放在配置下面.

[automount]
enabled = true
options = "metadata"

参考:

自动配置WSL

Chmod/Chown WSL改进

Running bash on windows 10, the simple syntax below works when I SSH to my webserver, but not when I exit out and am on my local machine. It doesn't give me an error, but I can see permissions are unchanged. I have to checked that I am set up as an administrator on my computer. Is this an error or is this just a consequence of the local operating system being windows? IF the later, it makes me question the value of using bash on windows if common operations such as this won't work.

$chmod 644 filename 

解决方案

Amade's answer is correct, but please note, the cmd only take effect in session scope. If you exit current bash, you'll lose your setting.

To fix this, you need to edit /etc/wsl.conf. and put below config in.

[automount]
enabled = true
options = "metadata"

Ref:

Automatically Configuring WSL

Chmod/Chown WSL Improvements

这篇关于chmod WSL(Bash)不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆