V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
rateltalk
V2EX  ›  问与答

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

  •  
  •   rateltalk · Apr 4, 2020 · 2568 views
    This topic created in 2214 days ago, the information mentioned may be changed or developed.

    准备薅美帝资本金的羊毛,开了个永久免费的 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')).
    
    Supplement 1  ·  Apr 5, 2020
    结贴,感谢回答,解决如下:

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

    2. 取消添加的权限
    setfacl -R -b
    5 replies    2020-04-05 06:32:57 +08:00
    noreplay
        1
    noreplay  
       Apr 4, 2020 via Android
    盲猜一下,是不是 SSH 登录的那个用户和网站目录的用户不是一个用户?或者网站还行运行,目录被保护起来了?
    rateltalk
        2
    rateltalk  
    OP
       Apr 5, 2020 via iPhone
    @noreplay 是的,网站目录用户是 www,登录用户是 ubuntu
    noreplay
        3
    noreplay  
       Apr 5, 2020 via Android
    用 www 给 Ubuntu 授个权限,应该就可以了
    Kobayashi
        4
    Kobayashi  
       Apr 5, 2020 via Android
    ACL, man setfacl
    putaozhenhaochi
        5
    putaozhenhaochi  
       Apr 5, 2020 via Android
    还有这福利!看了下。没信用卡 作罢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   989 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 19:11 · PVG 03:11 · LAX 12:11 · JFK 15:11
    ♥ Do have faith in what you're doing.