Resetting sudo passwd

I think i’ve messed something up with my sudo password. I changes my login account from administrator to Standard and after that it wont accept my sudo password. I cant seem to find a way to resetting. (I’m rather new to Linux and an “entry level user” so finding it a bit difficult).

Ran sudo su-

got the anser

kristiang does not exist in the sudoers file.

try

su

only

sudo su

passwd

See man passwd ( via terminal)

Welcome to the forum! :wave:

Did you mean account? :wink:

Please edit your post to correct your spelling errors.

A sincere effort to use modest and proper language and grammar is a sign of respect toward the community that will certainly be appreciated and is quite likely to elicit positive responses.

Forum Rules - Manjaro

If I understood correctly,this is not a password problem but a permission problem: your user now isn’t permitted to use sudo
You have to log in as root for the things you did before via sudo or (as root user ) re-assign the ẁheel group to your account kristiang:

# usermod -G wheel kristiang
1 Like

What do I do if I don´t know what my root password is?

usermod -G wheel kristiang                                                                                                                                         1 ✘ 
usermod: Permission denied.
usermod: kan inte låsa /etc/passwd; försök igen senare.

You could chroot your system from a live USB and from here, as you’re chrooted… as root… change the root password or do other administrative tasks, like adding back the proper permission to your user.

from live USB in terminal

manjaro-chroot -a

then do your things (changing root password, or whatever) on your chrooted system, when done exit the chroot and reboot

exit
reboot

So

 manjaro-chroot -a
sudo passwd

Then

usermod -G wheel kristiang

Since im a total newbie I need clear step by step instructions :smiley: :wink:

once you have issued the manjaro-chroot -a command, you answer the question if you have multiple system or if it doesn’t select automatically your system, then you are ROOT user already, on your system in the terminal (prompt should change color to red). Then as you are ROOT user, you do not use sudo so to change the password of the ROOT account you issue the command passwd and to assign the wheel group to your user you issue the command usermod -G wheel kristiang then you exit to unmount the system properly, and you reboot.

This goes without a manjaro iso:

  1. Boot your system to the grub menu. Type ESC when booting if the menu is hidden.
  2. Edit the menu entry with E
  3. Add at the line starting with linux this:
init=/usr/bin/bash
  1. Type F10 to boot. That is temporary and only affects that boot. If you have a bootsplash, then type ESC to close it. If the screen stays black, type ENTER to see a bash prompt.
  2. Now at the bash session, remount the root file system writable:
mount -n -o remount,rw /
  1. Overwrite any password you like:
# change the root password:
passwd root
# add yourself to the admin group:
usermod -aG wheel kristiang
# change your own password:
passwd kristiang
  1. Type reboot to reboot the system.

Sure, you must have physical access to the machine to change it like that.


However… the modern approach is using systemd.unit=emergency.target or systemd.unit=rescue.target instead of init=/usr/bin/bash, but you need in both cases the root password.

Here is a good overview: Understanding systemd at startup on Linux | Opensource.com

1 Like