V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
s609926202
V2EX  ›  问与答

vscode 远程开发用 ubuntu 用户登录时,网站文件目录下无法创建.vscode 用于开启远程调试,如何解决?

  •  
  •   s609926202 · 2020-04-04 23:41:33 +08:00 · 2116 次点击
    这是一个创建于 1453 天前的主题,其中的信息可能已经有所发展或是发生改变。

    准备薅美帝资本金的羊毛,开了个永久免费的 oracle 虚拟主机,用于小项目远程开发。
    使用 vscode 中 remote-ssh,用 ubuntu 用户登录虚拟主机,没有权限在网站目录下创建.vscode 文件,这个咋破解?

    如图:

    Unable to create 'launch.json' file inside the '.vscode' folder (Unable to write file 'vscode-remote://ssh-remote+xxxx/home/wwwroot/wordpress/.vscode/launch.json' (NoPermissions (FileSystemError): Error: EACCES: permission denied, mkdir '/home/wwwroot/wordpress/.vscode')).
    
    第 1 条附言  ·  2020-04-05 23:05:44 +08:00
    结贴,感谢回答,解决如下:

    1. 目录 dirname 增加 ubuntu 用户操作权限
    setfacl -R -m u:ubuntu:rwx dirname

    2. 取消添加的权限
    setfacl -R -b
    5 条回复    2020-04-05 06:32:57 +08:00
    noreplay
        1
    noreplay  
       2020-04-04 23:56:34 +08:00 via Android
    盲猜一下,是不是 SSH 登录的那个用户和网站目录的用户不是一个用户?或者网站还行运行,目录被保护起来了?
    s609926202
        2
    s609926202  
    OP
       2020-04-05 00:08:54 +08:00 via iPhone
    @noreplay 是的,网站目录用户是 www,登录用户是 ubuntu
    noreplay
        3
    noreplay  
       2020-04-05 00:11:44 +08:00 via Android
    用 www 给 Ubuntu 授个权限,应该就可以了
    Kobayashi
        4
    Kobayashi  
       2020-04-05 03:46:21 +08:00 via Android
    ACL, man setfacl
    putaozhenhaochi
        5
    putaozhenhaochi  
       2020-04-05 06:32:57 +08:00 via Android
    还有这福利!看了下。没信用卡 作罢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3127 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:41 · PVG 20:41 · LAX 05:41 · JFK 08:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.