solved Sudo..I'm confused

Brickwizard

Well-Known Member
Joined
Apr 28, 2021
Messages
6,031
Reaction score
4,119
Credits
44,693
my little ZG5 had 32 bit MX but after the last update threw a wobbly as it made the installation bigger than the 16gb zif drive, .go into fallback mode, install Debian 10 32 bit
great so far, its running quicker and cooler
Problem.. I wish to install a couple of apps that are not in buster repository this is the response [ I keep getting I know I am using the correct password [only set it up this PM.]
[
brian@wizard-AOA110:~$ sudo apt update
[sudo] password for brian:
Sorry, try again.
[sudo] password for brian:
brian is not in the sudoers file. This incident will be reported.

/QUOTE]
not had this problem before any thoughts?

Bwiz
 
Last edited:


Can you share the output of.
Code:
id
 
Become Root. Type: su -
(note the hyphen)

Then do: apt install sudo
(It may say it is already installed}

Then do: usermod -a -G sudo brian

Reboot

(Some people say you can use: adduser
but I don't understand this.)
 
Hi i will get it and boot it up a bit later its on charge at the moment
to give a bit of background this afternoon I did the edit grub change pasword [just in case I had sufferd a typo] which was accepted then the usual crlt+alt+del to confirm and re-boot
 
thanks for coming to help, all thease years using sudo never had this happened before

@f33dm3bits
brian@wizard-AOA110:~$ id
uid=1000(brian) gid=1000(brian) groups=1000(brian),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),115(bluetooth),121(lpadmin),124(scanner)

@arochester
brian@wizard-AOA110:~$ su -
Password:
su: Authentication failure
brian@wizard-AOA110:~$ apt install sudo
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
 
thanks for coming to help, all thease years using sudo never had this happened before

@f33dm3bits


@arochester
You aren't a member of the sudo group so you need to add your user to the sudo group as @arochester mentioned. You are getting an error when switching to the root user as well when entering the root password or you don't know the root password only the password of your normal user brian?
 
I changed the password this afternoon via grub, I was getting the same message before I changed it
sounds like i have an install error.. the ZG5 is now back in the office on charge
 
Morning boys, I learnt something this morning ..I cant jump from user to root, in the terminal, But i can enter root from the log in window
@f33dm3bits it is now working as root
@arochester tried to use your instructions [from root] ... usermod -a -G sudo brian result was command not found
 
What's the output of the following?
Code:
dpkg --list | grep passwd
 
dpkg --list | grep passwd
root@wizard-AOA110:~# dpkg --list | grep passwd
ii base-passwd 3.5.51 i386 Debian base system master password and group files
ii passwd 1:4.8.1-1 i386 change and administer password and group data
 
Strange the passwd package provides usermod. Can you share the output of the following?
Code:
which usermod
ls -l /usr/sbin/usermod
grep sudo /etc/group
 
grep sudo /etc/group
root@wizard-AOA110:~# which usermod
/usr/sbin/usermod
root@wizard-AOA110:~# ls -l /usr/sbin/usermod
-rwxr-xr-x 1 root root 144664 Feb 7 2020 /usr/sbin/usermod
root@wizard-AOA110:~# grep sudo /etc/group
sudo:x:27:

this is the result as root Will log out and come back with the results as user in a few mins
 
and as user
brian@wizard-AOA110:~$ ls -l /usr/sbin/usermod
-rwxr-xr-x 1 root root 144664 Feb 7 2020 /usr/sbin/usermod
brian@wizard-AOA110:~$ grep sudo /etc/group
sudo:x:27:
 
As root can you try running the following and share the output?
Code:
/usr/sbin/usermod -aG sudo brian
id brian
 
/usr/sbin/usermod -aG sudo brian
root@wizard-AOA110:~# /usr/sbin/usermod -aG sudo brian
root@wizard-AOA110:~# id brian
uid=1000(brian) gid=1000(brian) groups=1000(brian),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),115(bluetooth),121(lpadmin),124(scanner)
 
root@wizard-AOA110:~# /usr/sbin/usermod -aG sudo brian
root@wizard-AOA110:~# id brian
uid=1000(brian) gid=1000(brian) groups=1000(brian),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),115(bluetooth),121(lpadmin),124(scanner)
That went as expected, your user brian is now a member of the sudo group, if you logout and back into your DE you should be able to run: sudo apt update && sudo apt upgrade.
 
That went as expected, your user brian is now a member of the sudo group,
faild...
brian@wizard-AOA110:~$ sudo /etc/apt/sources.list
[sudo] password for brian:
brian is not in the sudoers file. This incident will be reported.
 
What happens if you just use su to become Root?

Debian has two versions of su
There's su (no hyphen) which will take you into the user's account
and su - (with hyphen) which will take you into the System Root

Try su -
and
apt update && apt full-upgrade
 

Members online


Top