Talk:Users and groups

From ArchWiki
Jump to: navigation, search

Username change tips

On 2nd though I'm unsure about the edit "Merging "change a user's login name" + Username change tips".

Does the Username change tips apply *only* for change of a user's login name or to *all* usermod commands for the active user ? Ua4000 (talk) 16:23, 22 June 2017 (UTC) 2017-06-22T18:23:28‎ Ua4000

Now it should be correct, "Change a user's login name or home directory" is in one chapter, together with the infos + warning about the change on a actual user. Ua4000 (talk) 19:13, 23 June 2017 (UTC)

Unclear to me: Change a user's login name or home directory

This instructions from the page could be clearer:

To change a user's home directory:

# usermod -d /my/new/home -m username

The -m option also automatically creates the new directory and moves the content there.

Tip: You can create a link from the user's former home directory to the new one. Doing this will allow programs to find files that have hardcoded paths.
# ln -s /my/new/home/ /my/old/home

Make sure there is no trailing / on /my/old/home.

Can we add an example? Say username is archie and old home folder was /mnt/sda3/home/archie. New home directory shall become /home/archie. So, according to the instrcutions:

# usermod -d /home/archie archie

(Not using -m because files shall stay at /mnt/sda3/home/archie)

Then create a link from former home directory /mnt/sda3/home/archie to the new one /home/archie, so:

# ln -s /home/archie/ /mnt/sda3/home/archie

However then there is a link in /mnt/sda3/home/archie/ archie that points to /home/archie. Shouldn't it be the other way around? So when the system looks up /home/archie instead it will go to /mnt/sda3/home/archie?

Thanks in advance -- GNUrocks (talk) 20:50, 26 October 2017 (UTC)

The tip assumes that the -m flag was used. This is indicated in the first sentence: "You can create a link from the user's former home directory to the new one." -- Lahwaacz (talk) 21:02, 26 October 2017 (UTC)

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)

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)

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)

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)

Remove "-g initial_group"

I'd like to remove the -g/--gid option from Users and groups#User management as it gives the impression that it's a required option. Setting a different primary group is rarely desired and generally advised against.

Since the section doesn't list -u/--uid and some other options supported by useradd(8), it shouldn't be an issue to additionally omit -g/--gid.

-- nl6720 (talk) 10:20, 12 January 2019 (UTC)

OK, but the default behaviour regarding the initial group should still be described. -- Lahwaacz (talk) 10:25, 12 January 2019 (UTC)