Changeset b3d9df0


Ignore:
Timestamp:
10/02/2022 02:55:00 AM (19 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/llvm18, xry111/xf86-video-removal
Children:
66e251c7
Parents:
b66e67e0
Message:

useradd: add instructions for creating new user with same UID/GID on another system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/config/skel.xml

    rb66e67e0 rb3d9df0  
    133133<screen role="root"><userinput>useradd -m <replaceable>&lt;newuser&gt;</replaceable></userinput></screen>
    134134
     135  <para>
     136    If you are sharing a <filename class="directory">/home</filename>
     137    or <filename class="directory">/usr/src</filename> with another
     138    Linux distro (for example, the host distro used for building LFS), you
     139    can create a user with the same UID (and, same primary group GID) to
     140    keep the file ownership consistent across the systems.  First, on
     141    <emphasis>the other distro</emphasis>, get the UID of the user and the
     142    GID of the user's primary group:
     143  </para>
     144
     145<screen role="nodump"><userinput>getent passwd <replaceable>&lt;username&gt;</replaceable> | cut -d ':' -f 3,4</userinput></screen>
     146
     147  <para>
     148    The command should output the UID and GID, separated by a colon.  Now
     149    on the BLFS system, create the primary group and the user:
     150  </para>
     151
     152<screen role="root"><userinput>groupadd -g <replaceable>&lt;GID&gt;</replaceable> <replaceable>&lt;username&gt;</replaceable> &amp;&amp;
     153useradd -u <replaceable>&lt;UID&gt;</replaceable> -g <replaceable>&lt;username&gt;</replaceable> <replaceable>&lt;username&gt;</replaceable></userinput></screen>
     154
    135155</sect1>
Note: See TracChangeset for help on using the changeset viewer.