[SOLVED] su and sudo passwords

Chat about anything related to Linux Mint
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
tomek_at_mint

[SOLVED] su and sudo passwords

Post by tomek_at_mint »

LM 19, a problem with su password.
I am the only user and administrator of my LM OS. sudo password does not work for su. My intention was to avoid password, as I am the only user of my laptop, however, when forced to give password I gave the one which is OK for an opening of the session and for sudo. su command is sometimes necessary and I do not know how to resolve my problem. My OS knowledge is limited and any hint or suggestion is welcome. Many thanks for your help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kukamuumuka

Re: su and sudo passwords

Post by kukamuumuka »

You need to activate root accout. Via Terminal

Code: Select all

sudo passwd root
User avatar
karlchen
Level 23
Level 23
Posts: 18155
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: su and sudo passwords

Post by karlchen »

Hello, tomek_at_mint.

By default, the command sudo expects to be given the user's password, in order to verify the requesting user is permitted to execute a command with root permissions.
By, default, the command su expects to be given the root password (root is a user, too). Only if it gets it, it will execute a command with root permissions.
By default, on Mint 19, the root account is prevented from logging in. The root account does not have password, as administrollaattori had explained already.
For more details on root - sudo - su: see this official Ubuntu Wiki article: RootSudo

Best regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 750 days now.
Lifeline
tomek_at_mint

Re: su and sudo passwords

Post by tomek_at_mint »

Thank you for explanations!

Unaware of the reason for my problem with opening the Super User session I stupidly started to play with System Settings to change my password to one which I have invented. However, the system refused to accept my choice. Curiously during installation, the system did not put any constraint on the password but refused the new I proposed via system settings which was formally similar to the old one. Finally, I was driven to change the proposed password several times before I found the one which fulfilled the formal constraints of the system. It was very late, I forget to write the password, and the next day it appeared that I am unable to reproduce it. Fortunately, when I launch LM I am not asked for a password. I can continue to use my laptop. However, I cannot execute any administrative task. It is OK for a few days, for a week or perhaps for ten days, but at some moment this limitation will become untenable.

I apologize for being so long in my explanation. The question will be very short. My diagnosis is that the only solution is to install LM 19 again. It means a lot of work because of the applications I use. Am I right in my diagnosis, or perhaps there is a way to go around?

Thank you for your help.
gm10

Re: su and sudo passwords

Post by gm10 »

At the GRUB boot menu (hold shift after the BIOS screen if it does not come up automatically) select Advanced, then Recovery, finally the Root shell option.

Run

Code: Select all

mount -o rw,remount /
then reset your password with

Code: Select all

passwd YOURUSERNAME
(obviously use your actual user name here)
Last edited by gm10 on Sun Nov 04, 2018 2:33 am, edited 1 time in total.
tomek_at_mint

Re: su and sudo passwords

Post by tomek_at_mint »

Your advice helped me to restore access to functionalities protected by a password. It did not work immediately, some small problems with the code make it not operating immediately, but you learned me that it is possible to solve my problem. Knowing that I found how to correct it after some research on the internet.

It is the first time I searched the help in the LM forum. I am very impressed by the reactivity and excellence of the help. Many thanks for answers to you and to karlchen.

Tomek
gm10

Re: su and sudo passwords

Post by gm10 »

tomek_at_mint wrote: Sat Nov 03, 2018 8:47 pm some small problems with the code make it not operating immediately,
Whoops, sorry for that typo, I fixed it for the benefit of others finding this thread.

And you're welcome. :)
Locked

Return to “Chat about Linux Mint”