Score:0

How to login as root in Ubuntu?

ar flag

For some reasons, I need to run the whole GUI as root. So I tried to login root user account from ubuntu. I selected Not Listed? option. And I entered username root then when I enter the password it says That didn't worked... but that is the correct password for root user account.....

Can't I login as root??

I am using Ubuntu 20.04 LTS, up to date

sudodus avatar
jp flag
Ubuntu is designed so that you should not run as root, but with a normal user ID. Use `sudo program-name` to raise permissions when necessary, but do as much as possible with normal permissions. The reason is simple: avoid severe damage to the operating system by mistake. You can make exceptions, and run `sudo -i` and arrive at the root prompt `#` and get elevated permissions. But please avoid it when possible.
Just Me avatar
ar flag
When i try to open gedit as root using sudo i get something like _Unable to Open display: Connection refused_ what to do in that case?
ChanganAuto avatar
us flag
*For some reasons, I need to run the whole GUI as root.* Whatever those reasons are, they CAN'T be good. This is a X-Y problem.
sudodus avatar
jp flag
[This link](https://askubuntu.com/questions/961967/why-dont-gksu-gksudo-or-launching-a-graphical-application-with-sudo-work-with-w/961978#961978) may help you run gedit and nautilus with elevated permissions in a good way. Use the following command line: `gedit admin:///path/to/file`
heynnema avatar
ru flag
@sudodus `sudo -H gedit /path/to/file` should be easier. `sudo -H` should be used when starting any GUI app from the terminal CLI.
sudodus avatar
jp flag
@heynnema, Yes for a long time it was like that. But in the new versions of Ubuntu we no longer need -H. Anyway, it is considered safer to use that admin method with gedit, or simply stay with text mode tools with sudo.
heynnema avatar
ru flag
@sudodus In 21.04 `man sudo` still shows -H as a viable option. Do you know what/when the behavior that you describe kicked in?
sudodus avatar
jp flag
@heynnema, See [this post by a forum moderator at the Ubuntu Forums](https://ubuntuforums.org/showthread.php?t=2463801&p=14044344#post14044344). I think he will answer if you ask him directly.
heynnema avatar
ru flag
@sudodus I looked at your provided link. TL;DR... I'm not sure it applied to our conversation... but maybe I didn't spend enough time skimming it :-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.