![]() If you don't have the gksu package and you won't want to install it, you can use: sudo -H gnome-terminal , you would then be unable to interact with the password prompt. If you were to press Alt+ F2 and run sudo. Note that this works with gksu and gksudo because they use a graphical authentication dialog. A textbox labeled Run command (or similar) will appear and you can enter your command.įor example, it looks like this in Unity:Īnd like this in MATE (GNOME Flashback/Fallback, Xfce, LXDE are similar): ![]() Virtually every desktop environment provides a facility to run a command without having to open a terminal (which would then, if closed, usually cause the command to be terminated). (Since gksu is set to sudo-mode in Ubuntu by default, these should be equivalent.) Running gnome-terminal as root without a controlling non-root terminal: Since you have the gksu package installed, you can run gnome-terminal as root with either of: gksu gnome-terminal I present two ways: with gksu/ gksdo, and with the sudo command. You'll have a root shell in which commands you enter will be run as root (without having to precede them with sudo).īut if you really want to run the graphical terminal emulator application as root, read on. What you probably want is a shell running as root, as though it were produced from a root login (for example, with all the environment variables set for root rather than for your user).Īssuming that's what you want, as steeldriver has suggested, just run: sudo -i It's located at /usr/bin/gnome-terminal and can be run with the gnome-terminal command. The prompt for root access did not exist when I wrote this answer.The default terminal emulator on Ubuntu is the GNOME Terminal. The absolute best thing to do to is make a copy of a restricted file, edit it, and copy it back when you're absolutely sure it's finished.Īlso for editing files to which your user does not have permissions, I would now recommend Talha Junaid's answer which asks for permissions every single time you want to save a file. I'm not saying that you should never use VSCode as root(though its pretty easy to avoid doing) I'm saying you should be careful when you want to do so and know the risks. It's just good practice on any operating system to run your applications on a user level and leave administrative tasks to the root user, and only on a per-need basis. Or that vulnerability that was just posted in ProFTPD to allow an attacker to gain a ROOT shell. For example, you wouldn't want that recent crash of Rhythmbox to wipe out your entire /usr directory due to a bug. ![]() Applications are meant to be run with non-administrative security (or as mere mortals) so you have to elevate their privileges to modify the underlying system. It defeats the security model that's been in place for years. Have fun.įor everyone asking why this isn't recommended, you clearly don't understand why sudo even exists. Then from the window you can open your project folderĪgain: This is not recommended. You must specify the user data directory to use when running vs code: sudo code -user-data-dir="~/.vscode-root" It is very dangerous to run VScode as root (as it is any other application) however, should you absolutely need to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |