Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Cannot log into root account

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
C8ha[ot-ajo
Posts: 4
Joined: 2024-03-21 01:23

[Software] Cannot log into root account

#1 Post by C8ha[ot-ajo »

Okay, I just installed Debian 12 and cannot log in as root, nor do I have sudo privileges. I can use Synaptic just fine. I haven't tried opening anything else as root. I am not a total stranger to the terminal. I actually need it to accomplish certain things. Is this a glitch in the Debian system? Just don't tell me I have to reinstall again.

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Software] Cannot log into root account

#2 Post by sunrat »

Do you mean you can't log in to root in a terminal? It's not possible to do by default in a graphical environment.
During installation, you need to set either a root password or a sudo password. Did you forget it?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: [Software] Cannot log into root account

#3 Post by FreewheelinFrank »

If you literally mean log into the root account, then no, you can't, it's disabled at the login screen, for good reason.

One does not simply walk into Mordor log in as root.

One acquires superuser privileges with

Code: Select all

su -
Have you tried that? There is obviously not a problem with the password if you can use Synaptic.

C8ha[ot-ajo
Posts: 4
Joined: 2024-03-21 01:23

Re: [Software] Cannot log into root account

#4 Post by C8ha[ot-ajo »

Okay su - gives me a root prompt but I don't really want it. The problem is the sudo privileges in the safer user account.

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Software] Cannot log into root account

#5 Post by sunrat »

So you didn't set up sudo during installation then.
Check if your user is in sudo group with the command , as user:

Code: Select all

groups
You can add your user to sudo group by first elevating root privileges:

Code: Select all

su -
be sure to add the dash! Then:

Code: Select all

adduser <username> sudo
Of course replace <username> with your actual username.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: [Software] Cannot log into root account

#6 Post by FreewheelinFrank »

If you enter a root password at install, sudo is not set up. You have to set it up post install.

https://wiki.debian.org/sudo/

Edit:Sorry sunrat. Didn't notice you had just posted.

C8ha[ot-ajo
Posts: 4
Joined: 2024-03-21 01:23

Re: [Software] Cannot log into root account

#7 Post by C8ha[ot-ajo »

Okay I am in the group with with a bunch of software. I tried the adduser thing but still get the error: paul is not in the sudoers file.

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Software] Cannot log into root account

#8 Post by sunrat »

You need to explain better. What does "a bunch of software" mean? sudo group should be in sudoers by default. You don't need your username in there as well.
Does sudo show when you run groups as user?
You do need to restart for the change to take effect.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

peer
Posts: 451
Joined: 2017-03-26 10:14
Has thanked: 9 times
Been thanked: 22 times

Re: [Software] Cannot log into root account

#9 Post by peer »

When I install debian I enable root so sudo is not installed
After installation I do:

Code: Select all

su -
apt update
apt install sudo
usermod -a -G sudo <username>
Then reboot

C8ha[ot-ajo
Posts: 4
Joined: 2024-03-21 01:23

Re: [Software] Cannot log into root account

#10 Post by C8ha[ot-ajo »

After the restart it worked. Thank you guys for all your help!

Post Reply