当我以username身份登录时,为什么给我看看/home/username而不是/root的内容?我认为sudo以根用户的身份执行命令,在这种情况下,~将表示/root。more解释:
此外,如果运行su命令,然后运行ls ~,则会显示/root的内容。所以我认为这样做等同于sudo ls ~。另一个例子是,一些带有--user标志的命令将在<
然后,vscode给我并建议我打开具有管理权限的vscode以实现安装的扩展,因此我在我的终端上写道:It is recommended to start vscode as a normal user.To run as root, you must specify an alternate user data directory with the --user-data-dir argument.
当尝试以sudo的形式运行命令时,我会得到一个错误。sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
sudo: If sudo is我没有运行任何容器和sudo在默认终端工作良好。
安装并正常运行,但当我试图在项目文件夹中保存文件时,它将返回拒绝的权限。所以,我重新运行代码It is recommended to start vscode as a normal user.To run as root, you must specify an alternate user data directory with the --user-data-dir argument.那么,如何在Ubuntu16.04中以根用户身份运