Announcement

Collapse
No announcement yet.

Problem with sudo

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with sudo

    Hello,

    Add my user to the wireshark group with sudo usermod -G wireshark jonatan and now when I try to execute any command with sudo I get the message that I do not belong to the sudoers file.

    Thanks.

    #2
    Originally posted by jony127 View Post
    sudo usermod -G wireshark jonatan
    Don't do that. What that command does is remove yourself from all of your existing secondary groups and only put you in the "wireshark" group. This excludes you from your default secondary groups (including the "sudo" group which is essential to using sudo...the default configuration in /etc/sudoers allows only users in the "sudo" group to use sudo). You can check this by running the "groups" command, it will only report groups "jonatan" (your primary group) and "wireshark" group.

    1. To add a specific user to a group and not remove from other groups, use either:
    Code:
    sudo usermod -[B]a[/B]G <group> <user>
    or
    Code:
    sudo adduser <user> <group>
    2. If you do not have another user that is still a member of the "sudo" group, your best option to restore your user groups is to:
    a. Boot into recovery mode root shell
    b. Remount the root filesystem as rw (it should be in read-only mode by default in the recovery mode root shell)
    Code:
    mount -o rw,remount /
    c. Run a command to restore your old groups, for example:
    Code:
    usermod -G adm,cdrom,sudo,dip,plugdev,sambashare,lpadmin,wireshark jonatan
    (you should of course include all the groups that you want for this, I can't give an all inclusive list as this depends on your installation...this list includes the default secondary groups for an admin user and the "wireshark" group.)

    d. reboot into normal mode
    Code:
    reboot
    Ask if you need more details or information
    Last edited by kubicle; Jan 30, 2017, 11:37 PM.

    Comment


      #3
      According to my reading of man usermod, you erased your list of supplementary groups with sudo -G wireshark jonatan; you should have added the -a option.

      On my 16.10 groups tells me "john adm cdrom sudo dip plugdev lpadmin sambashare", and a newly added administrator user was given "adm sudo lpadmin sambashare".

      I suggest you run
      Code:
      sudo usermod -a -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare jonatan
      (adjust jonatan if that was a typo in your original post)
      from another administrator user.
      Last edited by jlittle; Jan 30, 2017, 11:45 PM.
      Regards, John Little

      Comment


        #4
        ok thanks, it is solved. Any gui to manage groups easily?

        Comment


          #5
          I've installed kuser on my K14.04 system. It's easy to use.
          Desktop PC: Intel Core-i5-4670 3.40Ghz, 16Gb Crucial ram, Asus H97-Plus MB, 128Gb Crucial SSD + 2Tb Seagate Barracuda 7200.14 HDD running Kubuntu 18.04 LTS and Kubuntu 14.04 LTS (on SSD).
          Laptop: HP EliteBook 8460p Core-i5-2540M, 4Gb ram, Transcend 120Gb SSD, currently running Deepin 15.8 and Manjaro KDE 18.

          Comment

          Working...
          X