Changeset 991aa6f
- Timestamp:
- 05/12/2005 09:33:14 PM (18 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 6.1, 6.2, 6.2.0, 6.2.0-rc1, 6.2.0-rc2, 6.3, 6.3-rc1, 6.3-rc2, 6.3-rc3, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/inkscape-core-mods, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/python-mods, qt5new, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- 1cb62b2
- Parents:
- 5a1ffdd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
postlfs/config/skel.xml
r5a1ffdd r991aa6f 7 7 8 8 <sect1 id="postlfs-config-skel" xreflabel="Configuring for Adding Users"> 9 <sect1info> 10 <othername>$LastChangedBy$</othername> 11 <date>$Date$</date> 12 </sect1info> 13 <?dbhtml filename="skel.html"?> 14 <title>Configuring for Adding Users</title> 15 <indexterm zone="postlfs-config-skel"> 16 <primary sortas="e-etc-skel">/etc/skel/*</primary></indexterm> 17 <indexterm zone="postlfs-config-skel"> 18 <primary sortas="e-etc-default-useradd">/etc/default/useradd</primary> 19 </indexterm> 9 <?dbhtml filename="skel.html"?> 20 10 21 <para>Together, the <command>/usr/sbin/useradd</command> command and 22 <filename class="directory">/etc/skel</filename> directory (both are easy to 23 setup and use) provide a way to assure new users are added on your 24 <acronym>LFS</acronym> system with the same beginning settings for things 25 like <envar>PATH</envar>, keyboard processing and environmental variables. 26 Using these two facilities makes it easier to assure this initial state for 27 each new user.</para> 11 <sect1info> 12 <othername>$LastChangedBy$</othername> 13 <date>$Date$</date> 14 </sect1info> 28 15 29 <para>The <filename class="directory">/etc/skel</filename> directory holds 30 copies of various initialization and other files that may be copied to the 31 new user's home directory when the <command>/usr/sbin/useradd</command> 32 program adds the new user.</para> 16 <title>Configuring for Adding Users</title> 33 17 34 <para><emphasis>Useradd</emphasis></para> 18 <indexterm zone="postlfs-config-skel"> 19 <primary sortas="e-etc-skel">/etc/skel/*</primary> 20 </indexterm> 35 21 36 <para>The <command>useradd</command> program uses a collection of 37 default values kept in <filename>/etc/default/useradd</filename>, 38 if it exists. If the file does not exist, then it uses some internal 39 defaults. You can see the default values by running 40 <command>/usr/sbin/useradd -D</command>.</para> 22 <indexterm zone="postlfs-config-skel"> 23 <primary sortas="e-etc-default-useradd">/etc/default/useradd</primary> 24 </indexterm> 41 25 42 <para>To change these values to something new, create a base <filename> 43 /etc/default/useradd</filename> file with the same values as the output of 44 <command>/usr/sbin/useradd -D</command>. Here is a sample.</para> 26 <para>Together, the <command>/usr/sbin/useradd</command> command and 27 <filename class="directory">/etc/skel</filename> directory (both are easy to 28 setup and use) provide a way to assure new users are added on your LFS 29 system with the same beginning settings for things like <envar>PATH</envar>, 30 keyboard processing and environmental variables. Using these two facilities 31 makes it easier to assure this initial state for each new user.</para> 45 32 46 <screen># Begin /etc/default/useradd 33 <para>The <filename class="directory">/etc/skel</filename> directory holds 34 copies of various initialization and other files that may be copied to the 35 new user's home directory when the <command>/usr/sbin/useradd</command> 36 program adds the new user.</para> 37 38 <bridgehead renderas="sect5">Useradd</bridgehead> 39 40 <para>The <command>useradd</command> program uses a collection of 41 default values kept in <filename>/etc/default/useradd</filename>, 42 if it exists. If the file does not exist, then it uses some internal 43 defaults. You can see the default values by running 44 <command>/usr/sbin/useradd -D</command>.</para> 45 46 <para>To change these values to something new, create a base <filename> 47 /etc/default/useradd</filename> file with the same values as the output of 48 <command>/usr/sbin/useradd -D</command>. Here is a sample.</para> 49 50 <screen><literal># Begin /etc/default/useradd 47 51 48 52 GROUP=100 … … 53 57 SKEL=/etc/skel 54 58 55 # End /etc/default/useradd</ screen>59 # End /etc/default/useradd</literal></screen> 56 60 57 <para>The only thing missing from the file is a default shell. Add that58 by running:</para>61 <para>The only thing missing from the file is a default shell. Add that 62 by running:</para> 59 63 60 <screen ><userinput><command>/usr/sbin/useradd -D -s/bin/bash</command></userinput></screen>64 <screen role="root"><userinput>/usr/sbin/useradd -D -s/bin/bash</userinput></screen> 61 65 62 <para>This will set the <envar>SHELL</envar>= line to63 <envar>SHELL</envar>=/bin/bash.</para>66 <para>This will set the <envar>SHELL</envar>= line to 67 <envar>SHELL</envar>=/bin/bash.</para> 64 68 65 <para><command>Useradd</command> has many parameters that66 can be set in the <filename>/etc/default/useradd</filename> file.</para>69 <para><command>Useradd</command> has many parameters that 70 can be set in the <filename>/etc/default/useradd</filename> file.</para> 67 71 68 <para>For more information see <command>man useradd</command>.</para>72 <para>For more information see <command>man useradd</command>.</para> 69 73 70 <para><emphasis>/etc/skel</emphasis></para>74 <bridgehead renderas="sect5">/etc/skel</bridgehead> 71 75 72 <para>To get started, create an 73 <filename class="directory">/etc/skel</filename> directory and make sure it is 74 writable only by the system administrator, usually root. Creating the 75 directory as root is the best way to go.</para> 76 <para>To get started, create an <filename 77 class="directory">/etc/skel</filename> directory and make sure it is 78 writable only by the system administrator, usually <systemitem 79 class="username">root</systemitem>. Creating the 80 directory as <systemitem class="username">root</systemitem> is 81 the best way to go.</para> 76 82 77 <para>The mode of any files from this part of the book that you put in78 <filename class="directory">/etc/skel</filename> should be writable only by79 the owner. Also, since there is no telling what kind of sensitive information80 a user may eventually place in their copy of these files, you should81 make them unreadable by "group" and "other".</para>83 <para>The mode of any files from this part of the book that you put in 84 <filename class="directory">/etc/skel</filename> should be writable only by 85 the owner. Also, since there is no telling what kind of sensitive information 86 a user may eventually place in their copy of these files, you should 87 make them unreadable by "group" and "other".</para> 82 88 83 <para>You can also put other files in84 <filename class="directory">/etc/skel</filename> and85 different permissions may be needed for them.</para>89 <para>You can also put other files in 90 <filename class="directory">/etc/skel</filename> and 91 different permissions may be needed for them.</para> 86 92 87 <para>Decide which initialization files should be provided in every (or most) 88 new user's home directory. The decisions you make will affect what you 89 do in the next two sections, <xref linkend="postlfs-config-profile"/> and 90 <xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be 91 useful for root, any already-existing users, and new users.</para> 93 <para>Decide which initialization files should be provided in every (or most) 94 new user's home directory. The decisions you make will affect what you 95 do in the next two sections, <xref linkend="postlfs-config-profile"/> and 96 <xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be 97 useful for <systemitem class="username">root</systemitem>, any 98 already-existing users, and new users.</para> 92 99 93 <para>The files from those sections that you might want to place in94 <filename class="directory">/etc/skel</filename> include95 <filename>.inputrc</filename>, <filename>.bash_profile</filename>,96 <filename>.bashrc</filename>, <filename>.bash_logout</filename>,97 <filename>.dircolors</filename>, and <filename>.vimrc</filename>. If98 you are unsure which of these should be placed there, just continue to99 the following sections, read each section and any references provided,100 and then make your decision.</para>100 <para>The files from those sections that you might want to place in 101 <filename class="directory">/etc/skel</filename> include 102 <filename>.inputrc</filename>, <filename>.bash_profile</filename>, 103 <filename>.bashrc</filename>, <filename>.bash_logout</filename>, 104 <filename>.dircolors</filename>, and <filename>.vimrc</filename>. If 105 you are unsure which of these should be placed there, just continue to 106 the following sections, read each section and any references provided, 107 and then make your decision.</para> 101 108 102 <para>You will run a slightly modified set of commands for files which103 are placed in <filename class="directory">/etc/skel</filename>. Each section104 will remind you of this. In brief, the book's commands have been written for105 files <emphasis>not</emphasis> added to106 <filename class="directory">/etc/skel</filename> and just send the results to107 the user's home directory. If the file is going to be in108 <filename class="directory">/etc/skel</filename>, change the book's command(s)109 to send output there instead and then just copy the file from110 <filename class="directory">/etc/skel</filename> to the appropriate111 directories, like <filename class="directory">/etc</filename>,112 <filename class="directory">~</filename> or the home directory113 of any other user already in the system.</para>109 <para>You will run a slightly modified set of commands for files which 110 are placed in <filename class="directory">/etc/skel</filename>. Each section 111 will remind you of this. In brief, the book's commands have been written for 112 files <emphasis>not</emphasis> added to 113 <filename class="directory">/etc/skel</filename> and just send the results to 114 the user's home directory. If the file is going to be in 115 <filename class="directory">/etc/skel</filename>, change the book's command(s) 116 to send output there instead and then just copy the file from 117 <filename class="directory">/etc/skel</filename> to the appropriate 118 directories, like <filename class="directory">/etc</filename>, 119 <filename class="directory">~</filename> or the home directory 120 of any other user already in the system.</para> 114 121 115 <para><emphasis>When Adding a User</emphasis></para>122 <bridgehead renderas="sect5">When Adding a User</bridgehead> 116 123 117 <para>When adding a new user with <command>useradd</command>, use118 the <option>-m</option> parameter, which tells119 <command>useradd</command> to create the user's home directory and120 copy files from <filename class="directory">/etc/skel</filename> (can be121 overridden) to the new user's home directory. For example:</para>124 <para>When adding a new user with <command>useradd</command>, use 125 the <option>-m</option> parameter, which tells 126 <command>useradd</command> to create the user's home directory and 127 copy files from <filename class="directory">/etc/skel</filename> (can be 128 overridden) to the new user's home directory. For example:</para> 122 129 123 <screen ><command>useradd -m jwrober</command></screen>130 <screen role="root"><userinput>useradd -m <replaceable>[newuser]</replaceable></userinput></screen> 124 131 125 132 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.