Score:-4

Can you login to root as a normal user?

ma flag

I was wondering if you could login as root, not through the terminal, but rather like you would if you made a normal user.

vanadium avatar
cn flag
Note that Ubuntu disables the root account for security purposes. It works with `sudo` instead. You are free to enable the root account, but you do so only if you are aware of the security implications.
Score:0
aq flag

I have tried and it worked on Ubuntu 22.04.


Try this

#set root password
sudo passwd root

sudo vim /etc/pam.d/gdm-autologin
##Annotate this line
#auth requied pam_succeed_if.so user != root quiet success

sudo vim /etc/pam.d/gdm-password
##Annotate this line
#auth requied pam_succeed_if.so user != root quiet success

vim /root/.profile
- mesg n 2> /dev/null || true
+ tty -s && mesg n || true

Then reboot


It's true that working directly under the root user is dangerous. It is more recommended to use sudo

vanadium avatar
cn flag
Please also comment on the implications of such action for security. Ubuntu by default disables the root account for a reason. We want users to follow your advise only if they are well informed and can make their own evaluation of the security implications.
Jason Lee avatar
aq flag
@vanadium thanks for advising!
ACTS 238 avatar
ma flag
@Jason Lee I tried doing what you did, but my computer got logged out, I had to fix it. I think you need to really fix your writing, because someone could have done something much worse.
Jason Lee avatar
aq flag
@ACTS 238 Emmm do you fix the problem? This method works for me on ubuntu20.04, it just modified the permission to prevent you from logging into the desktop using root. If it is not working for you, I think this has no influence on logging in with regular users.
ACTS 238 avatar
ma flag
I am using Ubuntu 22
Jason Lee avatar
aq flag
@ACTS 238 So you can log in now, do you need any more help?
ACTS 238 avatar
ma flag
I cannot login to root, I had to undo what you did, I think you made a type error. Can you please fix it? I tried doing what you told me, but I could not login to my main account, or root. (I double checked my password, so that is out of the question.)
Jason Lee avatar
aq flag
@ACTS 238 You means undo what I did makes you to be enable to login in your regular account? Sry for the trouble I caused you, I will try it on Ubuntu22.04 and edit the answer
I sit in a Tesla and translated this thread with Ai:

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.