Jump to content

Talk:Users and groups

From ArchWiki
Latest comment: 4 February by Fjarah in topic Add a list of non-default user groups?

Group list

It is a good idea to add a column with the default gid to every group in the wiki table ? e.g. what is group 102 ?

# ls -la  /usr/share/polkit-1
# drwxr-x--- 1 root  102  44 Dec 22 02:14 rules.d

Also I found in my cups directory files owned by 9xx. My first idea was to look in the wiki article...

Ua4000 (talk) 09:03, 24 December 2017 (UTC)Reply

You can find those in DeveloperWiki:UID / GID Database. Also note that there were recently some changes towards dynamic allocation of the IDs [1], so the table may not be entirely correct. -- Lahwaacz (talk) 09:09, 24 December 2017 (UTC)Reply

useradd primary / secondary group

I am noticing that the group created (with gid=uid) is empty by default in /etc/groups, is that expected or is it safer to also add manually the user in the group? Kewl (talk) 07:20, 20 May 2018 (UTC)Reply

The primary group is set in /etc/passwd, so it's fine that it appears empty in /etc/groups. Run groups to see all current groups. -- Lahwaacz (talk) 07:29, 20 May 2018 (UTC)Reply

Utilities to handle the shadow file in acrh

Referring the template:accuracy in the users and groups#Other tools related to these databases section: chage is just an example how one can modify the shadow file in arch. There are other utilties to modify other aspects of the shadow file. The versions of vipw and vigr in arch has far less options compared to Debian, for example. On arch, vipw -s exits with an error code of 1. Also compare vipw(8) to debian's man page. At the bottom of the later there is a reference to shadow-utils, as well as a link to passwd 1:4.5-1.1. shadow-utils is also mentioned for other distributions. Which is confusing. Can it be that shadow-utils has cease to exist at the upstream level, but continues to exist at the distributions level? Regid (talk) 17:01, 28 January 2019 (UTC)Reply

I'm not even sure how to parse any of this *or* the disputed section.
shadow is the only thing there is to discuss at all -- the upstream "shadow" project is mildly schizophrenic in that it calls itself "shadow" everywhere *except* the manpages which mention "shadow-utils". Debian packages the source package "shadow" as the split binary packages "login", passwd", and "uidmap" and does not package a binary package for either "shadow" or "shadow-utils" or anything else of the sort, while Fedora packages it as "shadow-utils". Arch Linux, Void Linux, Gentoo, OpenSUSE, Slackware, Solus, all have the "shadow" package.
The bug report plainly states that vigr, vipw specifically from util-linux are considered deprecated in favor acquiring those programs from the shadow project instead. (Then it was rejected in favor of un-deprecating the util-linux versions due to the shadow project not being responsible developers.) -- Eschwartz (talk) 21:25, 3 February 2019 (UTC)Reply
See this link for detail. chage,vigr and vipw them self are not deprecated. -- Fengchao (talk) 02:26, 2 April 2020 (UTC)Reply

Clarification in shared data info

In the second last paragraph in Example_adding_a_user, the wording can be improved a little perhaps. I had to reread it many times in order to understand what it meant. I could also suggest edits if required.

  1. May be an example group name like sdata can be used.
  2. Also mention about Access_Control_Lists as it is also a neat little way to give shared access to folders among multiple users or creating shared partition across multiple distros.

Let me know if I was being unclear with something due to my own bad english :p -- RaZorr (talk) 10:33, 24 December 2021 (UTC)Reply

Renaming a user/group

I renamed user and group XXX to YYY with usermod and groupmod and there is still a subuid and subgid. First time I hear about such a thing. We should maybe instruct how to rename these.

# grep XXX /etc -r
/etc/subgid:XXX:100000:65536
/etc/subuid:XXX:100000:65536

—This unsigned comment is by Aleb (talk) 21:17, 2 August 2024 (UTC). Please sign your posts with ~~~~!Reply

Don't suggest /etc/sudoers, suggest a .d drop-in

Currently the page suggest to edit /etc/sudoers which is bad practice as it is not manageable and will create needless pacnews.

The proper way of doing things is to create a /etc/sudoers.d drop-in, visudo can be used for this with the --file parameter too. C0rn3j (talk) 12:54, 11 September 2024 (UTC)Reply

We also need to update Sudo#Configuration to match. Erus Iluvatar (talk) 13:37, 11 September 2024 (UTC)Reply

Full user name

In my opinion there should be mentioned a way how to add a full name in the moment of creation of the user account, basically

# useradd -m -c John\ Doe john

Or perhaps the simple useradd -m john should be immediately followed by

# chfn john

which is interactive and does not need to have the full name escaped. Adam-Purkrt (talk) 20:34, 23 January 2025 (UTC)Reply

Users and groups#Other examples of user management already documents using chfn (and usermod with quotes instead of escapes) to add a full name.
I guess the -c option could be documented in Users and groups#User management and the example in Users and groups#Example adding a user could be extended to use it.
-- nl6720 (talk) 07:21, 24 January 2025 (UTC)Reply
I thought I have searched for usermod and chfn on the page, I must have searched elsewhere...
In my opinion the best would be to extend the first place where the reader meets useradd command, i.e. in Users and groups#User management with a note about -c option and add it to Users and groups#Example adding a user as well. Double quotes is better choice instead of escaping.
Adding a full name along with username is not something "other" in my opinion, it is a good practice. Adam-Purkrt (talk) 09:37, 24 January 2025 (UTC)Reply
Sounds good with one exception; -c doesn't need to be in Template:Note. -- nl6720 (talk) 14:08, 25 January 2025 (UTC)Reply

Add a list of non-default user groups?

Some way to view the user groups mentioned on-wiki would be helpful, I am trying to remember what group I had on a previous local user account and I can't remember what or where I got it from. This isn't currently possible to automate via templates from what I can see. Groups that are mentioned in articles on this wiki are plugdev from Razer peripherals/Logitech Unifying Receiver or realtime for professional audio. Manually curating this would probably be annoying and eventually forgotten, but a new template that uses Template:ic, that can be queried to list all main-namespace usages could be an alternative. That means it would not need to be maintained on this page besides the initial listing that displays them. Fjarah (talk) 16:04, 4 February 2025 (UTC)Reply