You are not logged in.

#1 2018-05-20 03:54:49

Norgra
Member
Registered: 2018-05-20
Posts: 15

[SOLVED]Can't login to user account after overwriting pacnew files.

Please help. I'm not sure what information to provide, but I'll list anything I can think of that may help. I installed pacui I went to do system maintenance and accidently overwrote all the pacnew files and maybe some other ones too. I can't get into my account, but I can login as root. Also, before I logged out of my account, sudo broke. "sudo unknown uid 1000 who are you?"

I'm really not sure what to do from here. If there's any further information that I can provide, please let me know. Thank you.

Last edited by Norgra (2018-05-20 19:44:36)

Offline

#2 2018-05-20 04:11:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Log in as root and find the UID and GID of your user by looking at long listing (ls -l) of files in the user home directory.  Then, look at the contents of /etc/passwd and see if the UID and GID files in that file match.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2018-05-20 10:03:05

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Also you should have automatic backups in /etc:
passwd-
group-
shadow-
gshadow-

Offline

#4 2018-05-20 16:56:07

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

ewaller wrote:

Log in as root and find the UID and GID of your user by looking at long listing (ls -l) of files in the user home directory.  Then, look at the contents of /etc/passwd and see if the UID and GID files in that file match.

I checked this and, assuming I did everything correctly, this is what I got:

total 4
drwx------ 66 1000 users 4096 May 19 14:56 norgra

I couldn't find this anywhere in my passwd file. In fact, it looks like it might be severely broken.

root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/usr/bin/nologin
daemon:x:2:2:daemon:/:/usr/bin/nologin
mail:x:8:12:mail:/var/spool/mail:/usr/bin/nologin
ftp:x:14:11:ftp:/srv/ftp:/usr/bin/nologin
http:x:33:33:http:/srv/http:/usr/bin/nologin
nobody:x:99:99:nobody:/:/usr/bin/nologin
systemd-journal-gateway:x:191:191:systemd-journal-gateway:/:/usr/bin/nologin
systemd-timesync:x:192:192:systemd-timesync:/:/usr/bin/nologin
systemd-network:x:193:193:systemd-network:/:/usr/bin/nologin
systemd-bus-proxy:x:194:194:systemd-bus-proxy:/:/usr/bin/nologin
systemd-resolve:x:195:195:systemd-resolve:/:/usr/bin/nologin
systemd-journal-upload:x:997:997:systemd Journal Upload:/:/sbin/nologin
uuidd:x:68:68::/:/sbin/nologin
systemd-journal-remote:x:998:998:systemd Journal Remote:/:/sbin/nologin
systemd-coredump:x:996:996:systemd Core Dumper:/:/sbin/nologin
dbus:x:81:81::/:/sbin/nologin
avahi:x:84:84:avahi:/:/bin/nologin
usbmux:x:140:140:usbmux user:/:/sbin/nologin
git:x:995:995:git daemon user:/:/usr/bin/git-shell
polkitd:x:102:102:Policy Kit Daemon:/:/usr/bin/nologin
rtkit:x:133:133:RealtimeKit:/proc:/bin/false
mysql:x:89:89:MariaDB:/var/lib/mysql:/sbin/nologin
sddm:x:994:994:Simple Desktop Display Manager:/var/lib/sddm:/sbin/nologin
ntp:x:87:87:Network Time Protocol:/var/lib/ntp:/bin/false
berbae wrote:

Also you should have automatic backups in /etc:
passwd-
group-
shadow-
gshadow-

I replaced the newer files with the back ups, but I still can't login.

Offline

#5 2018-05-20 16:59:45

loqs
Member
Registered: 2014-03-06
Posts: 17,511

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Did you examine the backup files before you overwrote the originals with them?  Did you create backups of the originals before overwriting them?
Edit:
What are the outputs of

# pwck -r
# grpck -r

Last edited by loqs (2018-05-20 17:06:17)

Offline

#6 2018-05-20 17:15:39

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

loqs wrote:

Did you examine the backup files before you overwrote the originals with them?  Did you create backups of the originals before overwriting them?
Edit:
What are the outputs of

# pwck -r
# grpck -r

Sadly no. I'm fairly new to Arch so I didn't think much of it until after the fact.

no matching password file entry in /etc/shadow
add user 'systemd-journal-gateway' in /etc/shadow? No
no matching password file entry in /etc/shadow
add user 'systemd-timesync' in /etc/shadow? No
no matching password file entry in /etc/shadow
add user 'systemd-bus-proxy' in /etc/shadow? No
no matching password file entry in /etc/shadow
add user 'systemd-journal-upload' in /etc/shadow? No
no matching password file entry in /etc/shadow
add user 'usbmux' in /etc/shadow? No
user 'ntp': no group 87
no matching password file entry in /etc/passwd
delete line 'colord:!!:17670::::::'? No
no matching password file entry in /etc/passwd
delete line 'cups:!!:17670::::::'? No
no matching password file entry in /etc/passwd
delete line 'nvidia-persistenced:!!:17670::::::'? No
no matching password file entry in /etc/passwd
delete line 'tor:!!:17670::::::'? No
pwck: no changes
no matching group file entry in /etc/gshadow
add group 'bin' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'daemon' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'sys' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'adm' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'tty' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'disk' in /etc/gshadow? No
group lp: no user cups
delete member 'cups'? No
no matching group file entry in /etc/gshadow
add group 'lp' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'mem' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'kmem' in /etc/gshadow? No
group wheel: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'wheel' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'ftp' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'mail' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'uucp' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'log' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'utmp' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'locate' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'rfkill' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'smmsp' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'proc' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'http' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'games' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'lock' in /etc/gshadow? No
group network: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'network' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'video' in /etc/gshadow? No
group audio: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'audio' in /etc/gshadow? No
group optical: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'optical' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'floppy' in /etc/gshadow? No
group storage: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'storage' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'scanner' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'input' in /etc/gshadow? No
group power: no user norgra
delete member 'norgra'? No
no matching group file entry in /etc/gshadow
add group 'power' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'nobody' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'users' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-journal' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-journal-gateway' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-timesync' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-network' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-bus-proxy' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-resolve' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-journal-upload' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'kvm' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'uuidd' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-journal-remote' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'systemd-coredump' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'dbus' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'avahi' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'usbmux' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'git' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'polkitd' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'rtkit' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'mysql' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'sddm' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'vboxusers' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'nvidia-persistenced' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'colord' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'render' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'tor' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'adbusers' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'syncthing-relaysrv' in /etc/gshadow? No
no matching group file entry in /etc/gshadow
add group 'cups' in /etc/gshadow? No
grpck: no changes

Offline

#7 2018-05-20 17:42:31

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

I don't see any entries that look like a normal user in that /etc/passwd file.  Are there any in the file you replaced it with?

The way out of this may be to use useradd with the -u  and -g options set to 1000, then set a passwd for the 'new' user.
But, you are not out of the woods yet.  The UID of the file you listed is 66.  According to https://wiki.archlinux.org/index.php/De … D_Database , 66 is the UID for tomcat6.  If you did not expect that file to be owned by tomcat6, there is more work to be done.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2018-05-20 17:52:55

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

ewaller wrote:

I don't see any entries that look like a normal user in that /etc/passwd file.  Are there any in the file you replaced it with?

The way out of this may be to use useradd with the -u  and -g options set to 1000, then set a passwd for the 'new' user.
But, you are not out of the woods yet.  The UID of the file you listed is 66.  According to https://wiki.archlinux.org/index.php/De … D_Database , 66 is the UID for tomcat6.  If you did not expect that file to be owned by tomcat6, there is more work to be done.

Useradd newperson, or should I use a different command?

Offline

#9 2018-05-20 17:53:28

loqs
Member
Registered: 2014-03-06
Posts: 17,511

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Having a UID of a normal user below 500/1000 is very unusual and would normally require reconfiguration to achieve a working system if that is intended.
Would also after fixing the normal user address the mismatches found by pwck and grpck.
edit:
@ewaller the 66 is the entries in the dir for 1000:users
edit2:
you need to set the users group to users or additional groups to include users

Last edited by loqs (2018-05-20 17:58:40)

Offline

#10 2018-05-20 17:56:55

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

I've noticed that KDE is behaving very strangely. Certain programs like Kate and Dolphin won't open while others such as Konsole will and the taskbar doesn't display my open applications properly.

Last edited by Norgra (2018-05-20 18:01:28)

Offline

#11 2018-05-20 18:06:56

loqs
Member
Registered: 2014-03-06
Posts: 17,511

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Did you create a normal user or are you running plasma as root?
If you still need help creating a normal user what is the output of

ls -ladn /home/norgra

Offline

#12 2018-05-20 18:09:55

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

loqs wrote:

Did you create a normal user or are you running plasma as root?
If you still need help creating a normal user what is the output of

ls -ladn /home/norgra

I'm running as root.

drwx------ 66 1000 100 4096 May 19 14:56 /home/norgra

Offline

#13 2018-05-20 18:34:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

loqs wrote:

@ewaller the 66 is the entries in the dir for 1000:users
edit2:
you need to set the users group to users or additional groups to include users

*Headdesk*   More Coffee for Eric.   Of course, you are correct.

Norgra wrote:
loqs wrote:

Did you create a normal user or are you running plasma as root?
If you still need help creating a normal user what is the output of

ls -ladn /home/norgra

I'm running as root.

*Facepalm*

Last edited by ewaller (2018-05-20 18:37:50)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#14 2018-05-20 18:41:55

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

ewaller wrote:
loqs wrote:

@ewaller the 66 is the entries in the dir for 1000:users
edit2:
you need to set the users group to users or additional groups to include users

*Headdesk*   More Coffee for Eric.   Of course, you are correct.

Norgra wrote:
loqs wrote:

Did you create a normal user or are you running plasma as root?
If you still need help creating a normal user what is the output of

ls -ladn /home/norgra

I'm running as root.

*Facepalm*

I'm aware that running as root is dangerous. It's a temporary solution.
Edit: I'm also open to better solutions.

Last edited by Norgra (2018-05-20 18:55:14)

Offline

#15 2018-05-20 19:00:17

seth
Member
Registered: 2012-09-03
Posts: 51,972

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Re-add your user ("nogra", I assume? Using uid/gid 1000 as ewaller already told you).
You basically nuked it when overriding /etc/password|shadow files.

Running KDE as root will have weird impact because several GUI clients (I'm pretty much sure about dolphin and quite about kate) actively prevent you from running them as UID0 (because that's genuinely a really bad idea)

Online

#16 2018-05-20 19:04:22

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Logging into a console as root is one thing.  I avoid it, but I sometimes do it.   But never, under any circumstances would I consider any of the large desktop environments as root (especially not bloated behemoths such KDE, Gnome or MS Windows) on any disk that I would not use subsequently for anything more than scrapping dog crap off of my shoe.  In practice, I won't run any GUI as root.   Ignoring the security issues that are beyond mind boggling,  the DEs have a bad habit of marking their territory by spraying a myriad of little, obscure files in multiple places, and touching ones they should have no business touching.  With root permissions, they can do this without restraint and cleaning it up is quite literally a fool's errand.

</rant>

Last edited by ewaller (2018-05-20 19:07:23)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#17 2018-05-20 19:08:33

loqs
Member
Registered: 2014-03-06
Posts: 17,511

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

seth wrote:

Re-add your user ("nogra", I assume? Using uid/gid 1000 as ewaller already told you).

@seth it was 1000:100

Offline

#18 2018-05-20 19:17:49

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

loqs wrote:
seth wrote:

Re-add your user ("nogra", I assume? Using uid/gid 1000 as ewaller already told you).

@seth it was 1000:100

I'm a little confused. Should the user add syntax be something like this?

useradd 1000:100 --uid --gid

Or am I missing something? I don't want to break my system anymore than I already have.

Offline

#19 2018-05-20 19:21:35

loqs
Member
Registered: 2014-03-06
Posts: 17,511

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

How did you create the user initially?
Users_and_groups#User_management
`man 8 useradd`

Offline

#20 2018-05-20 19:21:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

You may want to read man useradd

useradd -u 1000 -g 100 theNameOfYourUserProbablyNogra


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#21 2018-05-20 19:25:46

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

ewaller wrote:

You may want to read man useradd

useradd -u 1000 -g 100 theNameOfYourUserProbablyNogra

User added and password updated.
Edit: I'm in! Everything seems to be working. If there's anything else you think I need to do, please let me know. Thank you so much to everyone for helping me and for putting up with my ignorance.

Last edited by Norgra (2018-05-20 19:34:01)

Offline

#22 2018-05-20 19:41:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

Excellent.  Test your system for a bit, then edit your thread title and prepend [SOLVED]


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#23 2018-05-20 19:43:26

Norgra
Member
Registered: 2018-05-20
Posts: 15

Re: [SOLVED]Can't login to user account after overwriting pacnew files.

ewaller wrote:

Excellent.  Test your system for a bit, then edit your thread title and prepend [SOLVED]

There are a few things I'll need to fix such as remounting hard drives and setting zsh as default shell, but I'm capable of doing that myself. Marking as solved. Thanks again!

Offline

Board footer

Powered by FluxBB