0

I am just asking for a confirmation here since I'm not really sure how it works

So, I have Debian Stretch on my home machine, I was the sole user so I had a normal user account and used su - when I had to use administrative commands. I also use the root password to mount my other partitions in the GUI, such as the partition where my music is stored.

My cousin moved in with me and since he wants to learn how to use linux, I created an account for him and added him to the sudo group, to allow him to mount the media partition as well (we kinda like the same kind of music), but since then, when I want to mount the partition from my account, it looks like I have to use his password now, not the root password anymore.

So, I wanted to ask if this is a normal behavior (in which case, I just have to add my account to the sudo group as well) or if there was something I was doing wrong.

Thank you in advance.

In case you want to ask, I like the behavior of not mounting my other partitions by default. And I also like to not have my own account completely separated from administrative tasks as using sudo commands kinda tricks me sometimes.

Edit It looks like my question needs clarification

I can use su - in the terminal when I want to switch to root for my admin commands, but I was used to mount my other partitions using thunar who used to ask me for the root password, but now, when I want to mount my partitions, still using thunar, now, it prompts me my cousin's password instead of the root password.

  • 1
    Being asked someone else's password when running su is not normal. Perhaps your cousin changed the root password? Please add the exact command which works with another user's password. – Dmitry Grigoryev Mar 19 '18 at 7:34
  • Add the output of sudo -l run as the relevant user, please. – muru Mar 19 '18 at 7:37
  • @DmitryGrigoryev I mean, when using su - in the terminal, it works, but when I want to mount my partition from the file manager, it asks for his password... maybe I need to change the title of the question – gl_prout Mar 19 '18 at 7:42
  • 1
    @gl_prout And the name of this GUI you're using is? – Dmitry Grigoryev Mar 19 '18 at 7:47
  • @DmitryGrigoryev well, it's xfce's default file manager, thunar, I kinda forgot its name – gl_prout Mar 19 '18 at 7:49
1

How su and sudo work

  • su asks for password of the user that you are changing to (by default root).
  • sudo asks for the password of the user that you currently are.

Alternatives

  • With sudo you can also configure it to allow only a limited set of command for a user, e.g. mount my-media … (you don't have to give away root). Use sudoedit to edit the config file. It will check the file before saving. If you don't then you could stop sudo from working. If you don't have root password, or ability to do a live boot into a rescue OS, then you will be locked out.
  • If I remember correct, mount supports being able to add an entry to /etc/fstab that is not auto-mounted, but can be mounted by any user
  • I will definitely try your second alternative tonight when I get home – gl_prout Mar 19 '18 at 8:20
  • I had to document a little bit on fstab but now I can mount my partitions using my normal user account, thank you – gl_prout Mar 22 '18 at 6:32
  • 1
    Note on English usage: to document means to create documentation. – ctrl-alt-delor Mar 22 '18 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.