login password different from sudo password?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Fizz
Level 5
Level 5
Posts: 523
Joined: Mon Jul 15, 2019 8:17 am

login password different from sudo password?

Post by Fizz »

HI all-

As i understand things, in Mint (and Ubuntu) doesn't have a password for root. It is always locked. So to do things requiring elevated privelges, you use the password of your user account. How do other flavors of linux compare in this- still use user password or the root password?

In Mint, is it possible to have one password for logging into the system, and another password that is used for elevated priveleges (like sudo or su, updates, new installs, etc)? Seems like it would be a simple step for extra security.

Just curious. Thanks!

-Fizz
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: login password different from sudo password?

Post by rene »

su already needs a different password, the root password, i.e., the password of user "root", but as to sudo, yes, possible: you can set the rootpw, targetpw or runaspw options: see man sudoers. The same you can setup for polkit-based authentication, the authentication as used by most/all GUI tools, simply by throwing out unix-group:sudo from its AdminIdentities; sudo mv /etc/polkit-1/localauthority.conf.d/51-ubuntu-admin.conf{,.disabled}. Note for onlookers: of course best don't idly try that without having set a root password first.

Whether or not it actually gains you anything real I'll leave up to you to decide. I would find not.
User avatar
Pjotr
Level 24
Level 24
Posts: 20142
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: login password different from sudo password?

Post by Pjotr »

Fizz wrote: Wed Jul 29, 2020 9:47 pm In Mint, is it possible to have one password for logging into the system, and another password that is used for elevated priveleges (like sudo or su, updates, new installs, etc)? Seems like it would be a simple step for extra security.
A simple step for extra complexity. Not for extra security.

My advice: don't do that. Just go with the flow. You might find this article interesting, that I've written about security in Linux Mint and Ubuntu:
https://easylinuxtipsproject.blogspot.c ... urity.html
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Fizz
Level 5
Level 5
Posts: 523
Joined: Mon Jul 15, 2019 8:17 am

Re: login password different from sudo password?

Post by Fizz »

rene wrote: Wed Jul 29, 2020 10:27 pm su already needs a different password, the root password, i.e., the password of user "root",
Hmmm... in the pinned thread about passwords, it says that the root password is the same as that for the first user. It didn't seem like it could be changed.
A simple step for extra complexity. Not for extra security.
I don't have need for super-security (no secret rocket plans or anything), but after reading the pinned thread about passwords i got curious. I was thinking that if someone figured out my login password, then having a separate sudo password would help keep critical things safe.

-Fizz
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: login password different from sudo password?

Post by Hoser Rob »

Fizz wrote: Thu Jul 30, 2020 7:53 am
rene wrote: Wed Jul 29, 2020 10:27 pm su already needs a different password, the root password, i.e., the password of user "root",
Hmmm... in the pinned thread about passwords, it says that the root password is the same as that for the first user. It didn't seem like it could be changed.
Um, I doubt that. Read it again.
A simple step for extra complexity. Not for extra security.
I don't have need for super-security (no secret rocket plans or anything), but after reading the pinned thread about passwords i got curious. I was thinking that if someone figured out my login password, then having a separate sudo password would help keep critical things safe.
Um, no. You don't need a root password for security.

And if you are using a root password, the OS will assume you know EXACTLY what you're doing and let you completely trash your system with zero warning. In serious multiuser Linux/Unix setups, there's only one person with a root password, and that's the head sysadmin. There's a reason that Ubuntu/Mint, which are beginner oriented, do not set a root password by default.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Fizz
Level 5
Level 5
Posts: 523
Joined: Mon Jul 15, 2019 8:17 am

Re: login password different from sudo password?

Post by Fizz »

Hoser Rob wrote: Thu Jul 30, 2020 8:22 am
Fizz wrote: Thu Jul 30, 2020 7:53 am Hmmm... in the pinned thread about passwords, it says that the root password is the same as that for the first user. It didn't seem like it could be changed.
Um, I doubt that. Read it again.
Yep. i did. There is a line that says:
By default, on Linux Mint, the root password is the same as the password of the first user created (password chosen during the installation).
And i don't see anything that says it can be changed.

That said, i'm sure the instructions that rene gave in his reply to me would work.


-Fizz
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: login password different from sudo password?

Post by rene »

Fizz wrote: Thu Jul 30, 2020 7:53 am Hmmm... in the pinned thread about passwords, it says that the root password is the same as that for the first user. It didn't seem like it could be changed.
The root password being set the same as the first user's used to be the case on Mint but was abandoned semi-recently (Mint 19? 18?) with Mint from that point on following upstream Ubuntu's ways of not by default setting a root password at all. It is any case trivial to change/set: sudo passwd root. I do that to e.g. have access to a root-login on a virtual console, the Ctrl-Alt-F<n> text-terminals, but not as a "security" measure.

If you ping the author of the pinned post you refer to he or she may agree that it's better to change the wording.
jonau01
Level 3
Level 3
Posts: 177
Joined: Tue Apr 07, 2020 4:01 pm

Re: login password different from sudo password?

Post by jonau01 »

linux mint 19 you can sudo su using your password (the same one that you use to sudo + command>. So root password and your password is the same.

We can argue all day long between su and sudo su, but the end result is the same : you become root.

However you can not login using root with the defaut installation.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: login password different from sudo password?

Post by rene »

jonau01 wrote: Thu Jul 30, 2020 9:27 am linux mint 19 you can sudo su using your password (the same one that you use to sudo + command>. So root password and your password is the same.
No. sudo as described by default asks for the invoking user's password and makes you become root. You therefore then invoke su as root and hence need no password. If you still disagree: sudo passwd root and set it to something of your liking different from your user password and just try.
Locked

Return to “Beginner Questions”