What is sudo password in linux

What is my sudo password?

When installing things I am sometimes asked for my sudo password. I don’t remember ever having one or setting one. But I do know my su password which has always worked fine for me. It is not the same as my sudo as it doesn’t work when I try it. How do I find out what my sudo password is?

3 Answers 3

It is usually your personal login password. For example:

derek$ sudo ls /var/log/secret [sudo] password for derek: audit.log audit.log.1 audit.log.2 

This can be altered by policy files such as /etc/sudoers. See for example Set sudo password differently from login one

I tried my login password (lets say it is «hello») and some incorrect passwords. When I try incorrect passwords I get:Sorry, try again. When I try my login password I get:hello is not in the sudoers file. This incident will be reported.

You, user derek, may not have sudo permissions; ask your sysadmin. In your comment you gave a weird error message «hello is not in the sudoers file» I thought our hypothetical user:password was derek:hello; I would expect an error «derek is not in the sudoers file» but sudoers never contains passwords.

Sorry, I made a mistake. It did return «derek is not. » not «password is not. «. Also it is my personal laptop. I guess I am the sysadmin.

@Derek That means that your user is neither in /etc/sudoers nor in a group that is. Common convention is to have a group called wheel that will have sudo access and then add users to that group.

@Kyrias in debian since at least version 5.0 (Lenny), the sudo group has sudo permissions by default.

Источник

Why is the ‘sudo’ password different than the ‘su root’ password

On my personal machine, I often type sudo in front of certain commands in order to accomplish administrative tasks. I had hoped to avoid doing this throughout the day, by typing su root and providing the same password I usually do for sudo . However, the two passwords are not the same(I don’t know how to log in to su root ). Is running a command with sudo different than logging in with su root and running the same command? I think sudo and su root are the same, because when I type sudo whoami , I get root , as opposed to just whoami where I get my user-name.

Читайте также:  Установка загрузчика линукс минт

I came across this older thread because it was linked as related to a question I asked. The answers are very informative but leaves a question. On a personal machine (one user), how do you get a different password for root depending on whether you use sudo or su root? Isn’t there a single root password, defined when Linux is installed?

@fixer1234 As explained in John1024’s answer, when you use sudo , the system asks for your password to verify your identity, then checks /etc/sudoers to see if you’re allowed to run sudo. When you use su , the system requires you to input the password of the user you’re switching to. (I know this is now a very old question, but I wanted to add a clarification for the benefit of future viewers.)

@anonymoose, this question was about the OP’s personal machine. Typically, when you install Linux on your own machine, you would know if you gave root a different password from your regular user. The question indicates that the OP was surprised to find out that root had a different password.

@fixer1234 The OP might not have set a root password to begin with. Ubuntu’s installer doesn’t ask for a root password, and I’m sure that some other distros don’t.

4 Answers 4

Contrary to what their most common use would lead you to think, su and sudo are not just meant for logging in (or performing actions) as root.

su allows you to switch your identity with that of someone else. For this reason, when you type su , the system needs to verify that you have the credentials for the target user you’re trying to change into.

Читайте также:  Как включить wifi astra linux

sudo is a bit different. Using sudo allows you to run certain (or all, depending on the configuration) commands as someone else. Your own identity is used to determine what types of commands sudo will run for you under someone else’s identity: if you’re a trusted user (in the sense that the sysadmin trusts you), you’ll be allowed more free rein than, say, an intern. This is why sudo needs to verify your own identity rather than that of the target user.

In other words, trying to su to someone you’re not is like attempting to charge your purchases to a stolen credit card while using sudo is like selling your friend’s car by legal proxy.

As for what you were trying to do, just sudo su root , or even more simply sudo su and type your regular user password. This would roughly amount to replacing your friend’s credit card credentials with your own using the legal proxy they gave you :). It of course assumes the sudo configuration allows you to run su with escalated privileges.

Also, systems that come pre-configured with sudo access typically have the root account disabled (no root password), you can enable that using the passwd command after becoming root via sudo su .

Источник

What is a sudo password? [duplicate]

I am prompted for a sudo password. Since I am a user at a very basic level of knowledge, I am very shaky in getting to the terminal and/or using the commands. When I am told to take the step «enter sudo command», before which I am prompted for the » sudo password», what do I do? I’ve never set a sudo password. I see from other questions that there is a facility called passwd ; surely that has to be entered at the terminal. I’ll try it.

Читайте также:  Лучшие аудиоплееры для linux

It’s asking for your own password, with the assumption that you have ‘sudo’ privileges (ie. you can elevate your privileges and super-user-do)

3 Answers 3

The sudo password is your normal user password by default in Ubuntu.

@YufenyuyVeyehDider No. Comments are not for answers. It’s a short answer, but it answers the question.

This takes me no further forward. My copy of Ubuntu was downloaded from the internet: if I had been prompted for a password, I would have made a note of it. I remember no such prompt.

su used to be an acronym for Super User, i.e. root but now it stands for Substitute User. Root is like the administrator on Windows. And this makes sudo an acronym of Super User DO or Substitute User DO. By default su or sudo refers to root account (unless specified) which is generally password protected. Root account is password protected in order to restrict apps/normal users to perform certain tasks which can effect the performance of system or cause security threats.

Now, the sudo password is the password you used at the time of installation. Also, whenever you enter password it is hidden, i.e. no character/bullets/stars will appear like in Windows.

Thank you. Very useful from the point of view of explanation. My copy of Ubuntu was downloaded from the internet: if I had been prompted for a password, I would have made a note of it. I remember no such prompt.

Источник

Оцените статью
Adblock
detector