vScode显示了在安装我的Ubuntu的root/computer分区中保存文件的权限不足

发布于 2025-02-13 02:22:27 字数 133 浏览 2 评论 0原文

显示的Vscode无法保存'index.html':权限不足。选择“重试sudo”作为超级用户重试 在保存位于根/计算机目录中的文件时,该如何解决?

我希望没有超级用户无需超级用户就可以自动完成工作。我该怎么做?

VScode showing Failed to save 'index.html': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser
while saving a file located in the root/computer directory how can I solve this?

I want autosave work without super user or keep super user active. How can I do this, please?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

对不⑦ 2025-02-20 02:22:27

我访问的问题是,auth弹出窗口有一个问题,我注意到有许多具有同一问题的应用程序。

要解决,我建议您修改您的sudo选项,而不包括nopasswd。就我而言,碰巧我升级到了一个较新的OS版本,并且这两种操作都是

确保您使用相同情况的最简单方法是转到settings>用户您应该看到解锁选项

单击它,默认情况下,您应该获得请求密码的弹出窗口。如果不是那是您的真正问题,那不是VSCODE

The issue in my access was that the auth popup had an issue, I noticed there's many apps with the same issue.

To resolve I'd suggest revising your sudo options and don't include nopasswd. In my case it happened that I upgraded to a newer OS version and both actions

The easiest way to make sure you've the same case is to go to Settings > Users You should see unlock option
auth check
Click it and in default you should get a popup requesting your password. If not that's your real issue it's not vscode

遗忘曾经 2025-02-20 02:22:27

如果您希望它与Ubuntu用户(不是Sudo)一起使用,请使用以下命令更改特定文件或目录的所有权。

sudo chown -R $USER <path to file/ directory_name>
  • $ user是一个存储当前 ubuntu用户名的环境变量。
  • 要查找文件或文件夹的路径,请在文件居住的文件夹中使用pwd&amp;复制绝对路径,例如/home/user_name/desktop/folder_name/
  • 在上面的文件/ Directory_name&gt; 的路径上粘贴相同的路径。

注意:使用sudo用敏感的系统目录进行时要谨慎,因为不当使用可能会导致权限问题。

If you want it work with your ubuntu user(not sudo) then change the ownership of a particular file or directory using the below command.

sudo chown -R $USER <path to file/ directory_name>
  • $USER is an environment variable that stores the current ubuntu username.
  • To find the path to the file or folder, use pwd inside the folder where the file resides & copy the absolute path e.g. /home/user_name/Desktop/folder_name/.
  • Paste the same path in the place of <path to file/ directory_name> above.

Note: Be cautious when using sudo and chown with sensitive system directories, as improper usage can cause permission issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文