You are not logged in.
Pages: 1
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
There is nothing wrong. Sudo password is the users password.
Offline
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
More permissions than root? Root has full permissions and so can sudo.
Offline
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
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
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
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
Online
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
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
Thanks everyone. Now I have understood how sudo works.
I wish to you a nice day.
Offline
You're welcome! Don't forget to mark the thread as [SOLVED].
Offline
Pages: 1