You are not logged in.

#1 2012-11-27 21:29:57

jwhendy
Member
Registered: 2010-04-01
Posts: 621

/etc/gshadow: lock:!:: or lock::: ?

After an update, I was notified that my /etc/group and /etc/gshadow were inconsistent. I must have goofed during a manual update at some point, as there area two entries for the lock group.

In /etc/group, I have duplicate lines like so:

lock:x:54:
lock:x:54:

In /etc/gshadow, I have slightly different entries:

lock:::
lock:!::

For all the googling I can muster, I can't find an up to date /etc/group example to know which one to keep in /etc/gshadow. There's some similar posts but they don't end conclusively. The wiki doesn't really explain what all the group fields mean like it does for user management; nor does it specify how to tell if a group entry should have an empty second field or a "!". My gshadow file has instances of both, so I'm not sure which lock should have.

Offline

#2 2012-11-27 22:14:28

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: /etc/gshadow: lock:!:: or lock::: ?

I only have:

lock:!::

ᶘ ᵒᴥᵒᶅ

Offline

#3 2012-11-27 22:31:32

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: /etc/gshadow: lock:!:: or lock::: ?

@litemotiv: thanks for chiming in. That's a start! Now, if someone can just explain the difference between ! and an empty string, if it matters. I went with ::: simply because other groups I assumed are similar don't have "!", while programs I've added for which there are groups (mpd, avahi, etc.) do. Figured lock was more of a system thing, and other groups like that (ftp, mem, kmem, etc.) don't have it.

Offline

#4 2012-11-28 02:25:33

stewie
Member
Registered: 2009-05-16
Posts: 20

Re: /etc/gshadow: lock:!:: or lock::: ?

man gshadow

You might want to check the description of the encrypted password field.


We wants it, we needs it. Must have the precious. Arch Linux.

Offline

#5 2012-11-28 03:17:16

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: /etc/gshadow: lock:!:: or lock::: ?

@stewie: thanks for the tip.

encrypted password

Refer to crypt(3) for details on how this string is interpreted.
If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, users will not be able to use a unix password to access the group (but group members do not need the password).

The password is used when an user who is not a member of the group wants to gain the permissions of this group (see newgrp(1)).

This field may be empty, in which case only the group members can gain the group permissions.

A password field which starts with a exclamation mark means that the password is locked. The remaining characters on the line represent the password field before the password was locked.

This password supersedes any password specified in /etc/group.

Having read that, it's not entirely clear how this plays out practically. An example would be awesome. My point is:
- Empty field: a password can gain access to the group-owned files by those outside the group... but the password field is empty, so what's the password it's talking about a non-group user providing?

- !: no password can gain access to the file.

Not being a *nix guru... I'm still left with my question: should the lock group have an empty or locked password field?

Last edited by jwhendy (2012-11-28 03:18:00)

Offline

#6 2012-12-13 10:56:34

amadar
Banned
Registered: 2011-04-15
Posts: 147

Re: /etc/gshadow: lock:!:: or lock::: ?

I would also like input on whether to merge the lock::: or not, from the latest /etc/gshadow.pacnew file.

Offline

Board footer

Powered by FluxBB