The problem is, if you just use plain sudo, you will still be located inside the calling directory. The shell will attempt to CD into the root's home directory, which is not done with plain sudo (evident if you run sudo su and try to login). Using sudo -i will spawn a child shell, specifically the one listed in the root's password database.Ģ. For the most part, these seem to be safe, and they might even lower the risk of accidentally changing permissions of your important files.ġ. You will often see recommendations to either use sudo -i or sudo -H. But, to be fair, I actually think Microsoft has had a tendency to make even worse mistakes, such as their destruction of the Windows 11 taskbar implementation. What is a very serious problem, however, is the fact that Linux does not yet offer a decent GUI/desktop experience due many such silly problems that are not solved properly before migrating to new ways of doing things. Even some system administrators prefer it at times. ![]() Desktop users, in particular, prefer using GUIs, and there is nothing wrong with that. However, it has been, and still is, totally fair for desktop users to run the file manager ( Nautilus in Ubuntu) as root when installing programs and performing system tasks, because it is usually faster and easier than typing commands in the terminal. With Wayland, this seems to be disallowed by default, and applications will instead have to be updated to use polkit the problem is that some programs has not yet been updated for that, specifically Disk Partitioning Tools, and File Managers, which probably still runs their entire GUI as root. Running graphical applications with root privileges is not bad in itself, and has been the norm for years. Source: How does sudo handle $HOME differently since 19.10?. This problem was even worse before Ubuntu 19.10, because using plain sudo would not change the $HOME directory to root's home directory. The Kate GUI will not actually run as root, but instead it will try to make a copy of the file and replace the original with the copy.Īnother option is to use sudoedit from a terminal. Sometimes you might be editing system files or web server configurations in such cases you could simply open them in Kate, which should then automatically prompt you for root access securely. If anyone knows of a File Manager that can browse directories without its entire GUI needing root access, please let us know in the comments! Editing files ![]() Nemo's Open as root will spawn a full blown root GUI window, so you may want to avoid doing that but then again, I am not sure you have any alternative yet. Some directories might not be accessible without root access and browsing from a terminal is inconvenient. To be almost completely safe, you could just just run Linux from a bootable USB, and then run the specific GUI tools needing root from that.ģ. I think this is an ongoing process for many programs. This is outdated modern programs should only ask for root access for specific things, and not to run the entire GUI. By that I mean that the whole GUI will be run as root, and not just the actions and commands that needs root access. Apparently GParted, and possibly other disk tools, still needs to run as full blown root to format hard disks. ![]() For example, maybe you just need to add yourself to the When running GUI partition tools. When editing files not owned by yourself in this case, you, most likely, still do not need root access, but rather you should configure permissions for the files correctly. Very few programs actually needs to have root access, and I would personally be hesitant to trust any program that asks for root without proper justification.īut, there are still valid reasons you might want root access.ġ. Why do people want to run programs as root? Relying on gksudo is discouraged, since it has been removed, and might not work as intended in updated systems. In updated systems programs should prompt you if they need root privileges to run. Traditionally some Linux users would recommend the use of gksudo instead, but this has been removed in recent versions of Ubuntu, and should not be used. Of course, malware in Linux is fairly rare, so this is probably down to a few freak cases. Running graphical programs using sudo -i in Ubuntu is basically fine, in many cases but, doing so is somewhat insecure, since it means that the entire GUI of the program, including its dependencies, will be run as root, and this increases the attack surface for malware to exploit - in worst case, malware could gain complete control over your system!. There has been a lot of confusion about running GUI applications in Linux using the sudo command, in this article, I will try to clear up some of this mess.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |