You are not logged in.

#1 2021-09-28 02:48:11

Automath
Member
Registered: 2016-05-16
Posts: 115

What's the exact function of shadow.service ?

When I was moving through systems I updated users and groups by doing appending cat from every source group, shadow, gshadow to it's destiny ones, which unnicely created some duplicated users and groups and little other inconsistencies.

As you would expect this prevented shadow.service for being able to start, so I want to know which is the extent of the consequences from this?

For what I know it should go from little security issue, to mayor security break to total chaos; so I want to know how urgent would be to solve this particular issue, thanks.

Edit: @loqs, that command line is overwrite, and I appended so replace the '>' for '>>' and then it was exactly like that. I wouldn't have duplicated entries if I did simply '>'

I wanted to achieve simply what the command line does, transfer users, groups, and passwords from one system to another as a more straight forward method than installing the desktop home migration service, but I forgot to purge the files.

@Jasonwryan thank for teaching me how to use systemctl but that description it's the same that i read from

systemctl status shadow

and it's not very descriptive.

In what manner shadow checks integrity? what action does it takes after detecting a corruption? qwhat other services are expecting output/events from it?, etc.

Last edited by Automath (2021-09-28 04:44:14)

Offline

#2 2021-09-28 03:24:28

loqs
Member
Registered: 2014-03-06
Posts: 18,996

Re: What's the exact function of shadow.service ?

Automath wrote:

When I was moving through systems I updated users and groups by doing appending cat from every source group, shadow, gshadow to it's destiny ones, which unnicely created some duplicated users and groups and little other inconsistencies.

Please detail precisely what you did.  Was it really:

# cat /mnt/etc/passwd > /etc/passwd
# cat /mnt/etc/shadow > /etc/passwd
# cat /mnt/etc/group > /etc/group
# cat /mnt/etc/gshadow > /etc/group

What were you trying to achieve by adding entries from the old system?

Offline

#3 2021-09-28 03:26:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: What's the exact function of shadow.service ?

┌─[Shiv ~]
└─╼ systemctl cat shadow.service                                                                                                               
# /usr/lib/systemd/system/shadow.service
[Unit]
Description=Verify integrity of password and group files

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2021-09-28 06:24:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,251

Re: What's the exact function of shadow.service ?

cat /usr/lib/systemd/system/shadow.service
[Unit]
Description=Verify integrity of password and group files
After=systemd-sysusers.service

[Service]
Type=simple
# Always run both checks, but fail the service if either fails
ExecStart=/bin/sh -c '/usr/bin/pwck -r || r=1; /usr/bin/grpck -r && exit $r'
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7

https://man.archlinux.org/man/core/shadow/pwck.8.en
https://man.archlinux.org/man/core/shadow/grpck.8.en

Offline

Board footer

Powered by FluxBB