LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2019, 05:00 PM   #1
cablescatt
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Rep: Reputation: Disabled
Password not working


I'm very new to this be gentle with me. My root password stopped working in Time shift, terminal, in terminal I tried to log into superuser but was unable this is what happened It was working before I added dialout to user
g41m-combo@G41M-Combo:~$ sudo -i
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/bin/bash' as root on G41M-Combo.
g41m-combo@G41M-Combo:~$
 
Old 08-26-2019, 05:59 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,294
Blog Entries: 13

Rep: Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694Reputation: 3694
I think you need to configure your sudoers file to allow your username to execute the sudo command.

Log in as root and use the usermod command to add your username to the sudo group.
 
Old 08-26-2019, 06:19 PM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
added dialout ?

ahh, yeah that will kill sudo

man usermod
Quote:
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no
intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option.

If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be
changed via the -a option, which appends the user to the current supplementary group list.
Code:
sudo usermod g41m-combo -a -G dialout ## correct way
like @rtmistler says, you need to get root to re-add yourself as member of sudo
or explicitly add yourself via `visudo` again root required

tbh I'm surprised usermod lets you nuke group membership without at least warning you.
 
Old 08-26-2019, 06:48 PM   #4
cablescatt
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Password not working

I cant get to root as the password doesn't work I have try all I know and then some but here is some information that might help.

g41m-combo@G41M-Combo:~$ sudo -i
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/bin/bash' as root on G41M-Combo.
g41m-combo@G41M-Combo:~$ sudo password root
[sudo] password for g41m-combo:
sudo: password: command not found
g41m-combo@G41M-Combo:~$ sudo vipw -s
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/usr/sbin/vipw -s' as root on G41M-Combo.
g41m-combo@G41M-Combo:~$ sudo passwd -u root
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/usr/bin/passwd -u root' as root on G41M-Combo.
g41m-combo@G41M-Combo:~$


I also checked the groups here is what is in my groups notice that "sudo" is not on the list.



g41m-combo@G41M-Combo:~$ groups
g41m-combo adm dialout cdrom dip plugdev lpadmin sambashare
g41m-combo@G41M-Combo:~$

I hope this helps you or any one out there.
Thanks
 
Old 08-26-2019, 06:55 PM   #5
cablescatt
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried what Firerat gave me to see if it would correct it but here is what I got out of it.

g41m-combo@G41M-Combo:~$ sudo usermod g41m-combo -a -G dialout ## correct way
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/usr/sbin/usermod g41m-combo -a -G dialout' as root on G41M-Combo.
g41m-combo@G41M-Combo:~$


Thanks any more suggestions please keep them coming.
 
Old 08-26-2019, 07:28 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
yeah, that won't work
maybe you can confirm what you did with the dialout
was it
Code:
sudo usermod g41m-combo -G dialout
without the -a ?

what this would do is replace all your existing group memberships with just one group membership

your sudo powers cam from the fact that you were a member of the sudo group, which you are not a member now

so now we have the problem of how to get root back

as root
Code:
usermod -a -G sudo
Or, safer in light of this easy to make error
Code:
gpasswd -M g41m-combo sudo
check man gpasswd

another way, again as root
Code:
visudo
## opens edit of sud# User privilege specification
## you will see section like this

# User privilege specification
root    ALL=(ALL:ALL) ALL
g41m-combo  ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALLoers
tbh I'm not sure what editor is used by default,
on my system it is vim, but I may have manually configured that
vim is great but not easy if you have never used it


so, do you have a real root login?
some distros don't bother and default to sudo
some give you the option of sudo and don't setup root

if you don't have a real root password we will have to help you reset it
in advance I ask for output of
Code:
df /
I just want the partition your root fs is on so we can chroot and give you sudo back
 
Old 08-26-2019, 07:48 PM   #7
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,782

Rep: Reputation: 647Reputation: 647Reputation: 647Reputation: 647Reputation: 647Reputation: 647
have you tried
Code:
sudo su -
 
Old 08-26-2019, 08:03 PM   #8
cablescatt
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
O/S is Mint 19.1 I don't think I have set up a root login but here is the response to you question were root is on partition. When I installed I set up a password and it worked well until I add dialout. what about creating a new user and assign sudo to it, and new password then change G41M-Combo user after it becomes the new sudo user remove then on I just created?

g41m-combo@G41M-Combo:~$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 960379920 9038704 902486792 1% /


g41m-combo@G41M-Combo:~$ sudo su -
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/bin/su -' as root on G41M-Combo.


g41m-combo@G41M-Combo:~$ sudo usermod g41m-combo -G dialout
[sudo] password for g41m-combo:
Sorry, user g41m-combo is not allowed to execute '/usr/sbin/usermod g41m-combo -G dialout' as root on G41M-Combo.

each time I try to change any thing it ask for my password and if I'm not root it reject it.

Last edited by cablescatt; 08-26-2019 at 08:11 PM. Reason: g41m-combo@G41M-Combo:~$ su root Password: su: Authentication failure
 
Old 08-26-2019, 08:04 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,380

Rep: Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083Reputation: 3083
Quote:
Log in as root and use the usermod command to add your username to the sudo group.
To elaborate as far as I know the only way to accomplish the above is boot into recovery mode and select drop to a root shell prompt. The root partition is mounted but as read only. To mount it read/write use the mount command.

mount -o remount,rw /

To restore sudo group

adduser g41m-combo sudo

To quit recovery mode type exit and then reboot.

I have not booted into recovery mode in a long time so I can't not confirm exact wording of recovery mode. I also assume that Mint works the same as Ubuntu.

Last edited by michaelk; 08-26-2019 at 09:03 PM.
 
1 members found this post helpful.
Old 08-26-2019, 08:37 PM   #10
cablescatt
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you Thank you michaelk solved

To elaborate as far as I know the only way to accomplish the above is boot into recovery mode and select drop to a root shell prompt. The root partition is mounted but as read only. To mount it read/write us the mount command.

mount -o remount,rw /

To restore sudo group

adduser g41m-combo sudo

To quit recovery mode type exit and then reboot.

I have not booted into recovery mode in a long time so I can't not confirm exact wording of recovery mode. I also assume that Mint works the same as Ubuntu.

It works I have user assigned to sudo.

g41m-combo@G41M-Combo:~$ groups
g41m-combo adm dialout cdrom sudo dip plugdev lpadmin sambashare
g41m-combo@G41M-Combo:~$
Thank you
 
Old 08-26-2019, 10:27 PM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782


easier than I thought it would be
I was sure that recovery asks me for password
maybe it asks because I have one set.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to reverse proxy and password protect an application, but having issues with rewriting URLs and password protection not working d745fba1cb70ab9dc02a80ee Linux - Server 12 06-20-2019 01:30 AM
Unable to find Administrators password does not recognize my login password the only password I entered at setup of Linux scholarsgold Linux - Newbie 6 01-23-2018 04:58 PM
Ubuntu 11.04 encrypted LVM password not working after user login password change prateekm21 Linux - Security 0 10-29-2011 02:20 PM
ssh not prompting for password and thus not working quarry_06 Linux - Networking 2 12-14-2005 04:17 PM
Just change Samba password, not Unix password? sorrodos Linux - Networking 1 08-14-2003 08:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration