[SOLVED] su and sudo passwords

Chat about anything related to Linux Mint
Post Reply
tomek_at_mint
Level 1
Level 1
Posts: 3
Joined: Wed Oct 31, 2018 12:58 pm

[SOLVED] su and sudo passwords

Post by tomek_at_mint » Wed Oct 31, 2018 2:24 pm

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 Moem on Sun Nov 04, 2018 5:52 am, edited 1 time in total.
Reason: Marked this as [SOLVED] for you; please note that you can and should do this for your own topics. Thanks!

User avatar
administrollaattori
Level 15
Level 15
Posts: 5656
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: su and sudo passwords

Post by administrollaattori » Wed Oct 31, 2018 3:46 pm

You need to activate root accout. Via Terminal

Code: Select all

sudo passwd root

User avatar
karlchen
Level 19
Level 19
Posts: 9519
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: su and sudo passwords

Post by karlchen » Wed Oct 31, 2018 5:32 pm

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
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

tomek_at_mint
Level 1
Level 1
Posts: 3
Joined: Wed Oct 31, 2018 12:58 pm

Re: su and sudo passwords

Post by tomek_at_mint » Thu Nov 01, 2018 5:54 pm

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
Level 13
Level 13
Posts: 4661
Joined: Thu Jun 21, 2018 5:11 pm

Re: su and sudo passwords

Post by gm10 » Thu Nov 01, 2018 7:45 pm

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
Level 1
Level 1
Posts: 3
Joined: Wed Oct 31, 2018 12:58 pm

Re: su and sudo passwords

Post by tomek_at_mint » Sat Nov 03, 2018 8:47 pm

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
Level 13
Level 13
Posts: 4661
Joined: Thu Jun 21, 2018 5:11 pm

Re: su and sudo passwords

Post by gm10 » Sun Nov 04, 2018 2:34 am

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. :)

Post Reply

Return to “Chat about Linux Mint”