Su password and sudo password is different?

I believe this is a sort of setting problem, after giving the authentications to remote ssh using specific keys, the sudo seems to be somewhat affected.
I remember clearly the selection of exclude the use of password i gave a fault,
now after linking ssh, the su password and sudo is different, i don’t know why

sudo uses the current user’s password.
su uses root’s password.


su (substitute user) is used to switch users. It allows you to switch to your root account, which is why you need your root password. You can also use it to switch to other accounts on your computer as well, i.e. to get to jack’s account: su jack or su - jack.

sudo is used to temporarily elevate the current user to perform an action that normally only root can use. This user is in the /etc/sudoers file and have to use their user password to elevate themselves.


I agree with realmain, but I’d like to add that using sudo is recommended unless you have a specific reason to use su. The reason being that if you actually switch user accounts in the terminal, it is easier to mess things up than if you were simply using sudo to run 1 command as admin (Not that you definetly will mess up, it’s just that it is easier to mess up).