You are not logged in.

#1 2013-04-19 17:27:47

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

[SOLVED] sudo's password not changed

Hello everyone.

I wanted to change the root's password. And so I logged with root's account in a separate tty and I did, using passwd.
I thought changing root's password would changed the sudo's password too. But it didn't work.
What's wrong?

Thanks.

Have a nice day, Grant.

Last edited by Grant (2013-04-21 12:06:51)

Offline

#2 2013-04-19 17:28:51

cecar
Member
Registered: 2013-03-10
Posts: 39

Re: [SOLVED] sudo's password not changed

There is nothing wrong. Sudo password is the users password.

Offline

#3 2013-04-19 17:33:34

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: [SOLVED] sudo's password not changed

Are you sure?
In that case, how can sudo get more permissions?
Infact sudo should get root's permissions (or maybe I'm wrong).

Last edited by Grant (2013-04-19 17:35:25)

Offline

#4 2013-04-19 17:38:02

cecar
Member
Registered: 2013-03-10
Posts: 39

Re: [SOLVED] sudo's password not changed

More permissions than root? Root has full permissions and so can sudo.

https://wiki.archlinux.org/index.php/Sudo

Offline

#5 2013-04-19 17:40:25

opt1mus
Member
From: UK
Registered: 2011-12-31
Posts: 212
Website

Re: [SOLVED] sudo's password not changed

Grant wrote:

Are you sure?
In that case, how can sudo get more permissions?
Infact sudo should get root's permissions (or maybe I'm wrong).

You're wrong, it shouldn't get root's permissions by default, otherwise what's the point. It's to control what users can and cannot do whilst logging activity;

Have a good Read of The Fine Manual, that cecar posted.

Offline

#6 2013-04-19 17:46:27

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: [SOLVED] sudo's password not changed

But how can sudo get every permissions, if I don't give root's password when asked?
If I use my password to run programs as root, it isn't a little insecure?
It is repetitive, because I'm already logged, and so it's like a second log in.

Offline

#7 2013-04-19 17:48:51

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: [SOLVED] sudo's password not changed

It's to confirm that you are who you are logged in as, and no, say Mr. Stranger who has taken advantage of you being away from your keyboard.

You can change sudo to prompt for root's password if you want, I prefer it. The sudoers manpage explains how.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2013-04-19 18:03:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: [SOLVED] sudo's password not changed

A new user could *try* to run sudo, and use their own user password.  This will succeed if they have been added to the sudoers file to have such an ability - it will fail otherwise.

If sudoers needed to know the root password, then there would be no reason for sudo.  Sudo is a tool to allow non root users to have particular elevated priviledges.  The sudoers file defines which things they can do (if any).

Did you not (as root) edit your sudoers file and add your user to it?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2013-04-19 18:28:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: [SOLVED] sudo's password not changed

Grant wrote:

But how can sudo get every permissions, if I don't give root's password when asked?.

from my system:

ewaller$@$odin ~ 1001 %ls -l $(which sudo)
-rwsr-xr-x 1 root root 116888 Apr 11 16:03 /usr/bin/sudo
ewaller$@$odin ~ 1002 %

This shows the permissions for the program sudo.  Note the 's' in the permissions (-rwsr-xr-x)  That 's' means that when 'root' installed the program, he set the sticky bit; that bit tells the program to always run with the permissions of the owner.  Sudo always runs as root, no matter who invokes it.  The sudoers file tells that program which privileges are to be extended to which users, and how those users must identify themselves.

One might set the system up so that any user may shut the system down without any authentication.   
One might set the system up so that members of the 'wheel' group can do anything without authentication.
One might set the system up so that members of the 'wheel' group can do anything, but only after they prove who they are by entering their password.

Most of us use the last case.  I think that is the default.

Last edited by ewaller (2013-04-19 20:44:04)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#10 2013-04-20 00:43:25

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: [SOLVED] sudo's password not changed

Grant wrote:

But how can sudo get every permissions, if I don't give root's password when asked?
If I use my password to run programs as root, it isn't a little insecure?
It is repetitive, because I'm already logged, and so it's like a second log in.

It will only grant those permissions if the running user is listed in the sudoers file.
It's not a second login, it's granting full permission to a program. This should also be necesary for system-level configuration, and package installation.

If you insist on not typing your password when running sudo, you can configure it not to ever ask a password (though I wouldn't recomend you do this unless you're really sure what you're doing).

Offline

#11 2013-04-20 12:21:12

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: [SOLVED] sudo's password not changed

Thanks everyone. Now I have understood how sudo works.
I wish to you a nice day.

Offline

#12 2013-04-20 12:42:37

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: [SOLVED] sudo's password not changed

You're welcome! Don't forget to mark the thread as [SOLVED]. smile

Offline

Board footer

Powered by FluxBB