Changeset cfc2a54 for postlfs/config/skel.xml
- Timestamp:
- 08/22/2003 03:37:27 PM (21 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.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/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, v5_0, v5_0-pre1, v5_1, v5_1-pre1, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- 0108c1d
- Parents:
- 71f73f0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
postlfs/config/skel.xml
r71f73f0f rcfc2a54 1 1 <sect1 id="postlfs-config-skel"> 2 2 <?dbhtml filename="skel.html" dir="postlfs"?> 3 <title> /etc/skel</title>3 <title>Configuring for Adding Users</title> 4 4 5 <para>The <filename>/etc/skel</filename> directory is quite simple 6 to setup and use. It provides a way to make sure that all new users on 7 your LFS system begin with the same settings. The 8 <filename>/etc/skel</filename> directory is used by the 9 <filename>/usr/sbin/useradd</filename> program.</para> 5 <para>Together, the <filename>/usr/sbin/useradd</filename> command and 6 <filename>/etc/skel</filename> directory (both are easy to setup and use) 7 provide a way to assure new users are added on your LFS system with the 8 same beginning settings for things like $PATH, keyboard processing and 9 environmental variables. Using these two facilities makes it easier to 10 assure this initial state for each new user. 11 </para> 10 12 11 <para>For more information see <userinput>man useradd</userinput>.</para> 13 <para> 14 The <filename>/etc/skel</filename> directory holds copies of various 15 initialization and other files that may be copied to the new user's home 16 directory when the <filename>/usr/sbin/useradd</filename> 17 program adds the new user.</para> 12 18 13 <para>To get started create a <filename>/etc/skel</filename> directory. 14 Creating the directory as root is the best way to go. Next copy any 15 files into <filename>/etc/skel</filename> that you want every new user 16 to have placed in their home drive. Examples include 17 <filename>.bash_profile</filename>, <filename>.bashrc</filename>, 18 <filename>.bash_logout</filename>, <filename>dircolors</filename>, 19 <filename>.inputrc</filename> and <filename>.vimrc</filename>.</para> 19 <para>Useradd</para> 20 20 21 <para>When creating a new user with 22 <filename>/usr/sbin/useradd</filename> use the <userinput>-m</userinput> 23 parameter. For example:</para> 24 25 <para><screen><userinput>useradd -m -s/bin/bash jwrober</userinput></screen></para> 26 27 <para>The <filename>/usr/sbin/useradd</filename> program uses a 28 collection of default values. It will read them from the 29 <filename>/etc/default/useradd</filename> file if it exists. If the 30 file does not exist, then it uses some internal defaults. They can be 31 found by running <userinput>/usr/sbin/useradd -D</userinput>.</para> 21 <para>The <filename>useradd</filename> program uses a collection of 22 default values kept in <filename>/etc/default/useradd</filename>, 23 if it exists. If the file does not exist, then it uses some internal 24 defaults. You can see the default values by running 25 <userinput>/usr/sbin/useradd -D</userinput>. 26 </para> 32 27 33 28 <para>To change these values to something new, create a base … … 53 48 54 49 <para>This will set the <userinput>SHELL=</userinput> line to 55 <userinput>SHELL=/bin/bash</userinput>. This makes it even easier to 56 add new users to your LFS system. The 57 <filename>/usr/sbin/useradd</filename> has many parameters that can be 58 set in the <filename>/etc/default/useradd</filename> file. See the man 59 page for more details.</para> 50 <userinput>SHELL=/bin/bash</userinput>.</para> 51 52 <para><filename>Useradd</filename> has many parameters that 53 can be set in the <filename>/etc/default/useradd</filename> file. 54 </para> 55 56 <para>For more information see <userinput>man useradd</userinput>.</para> 57 58 <para>/etc/skel</para> 59 60 <para>To get started create an <filename>/etc/skel</filename> directory 61 and make sure it is writable only by the system administrator, usually 62 root. Creating the directory as root is the best way to go.</para> 63 64 <para>The mode of any files from this part of the book that you put in 65 <filename>/etc/skel</filename> should be writable only by the owner. 66 Also, since there is no telling what kind of sensitive information a 67 user may eventually place in their copy of these files, you should 68 make them unreadable by "group" and "other".</para> 69 70 <para>You can also put other files in <filename>/etc/skel</filename> and 71 different permissions may be needed for them. 72 </para> 73 74 <para> 75 Decide which initialization files should be provided in every (or most) 76 new user's home directory. The decisions you make will affect what you 77 do in the next three sections, "/etc/inputrc", "The Bash Shell Startup 78 Files" and "/etc/vimrc, ~/.vimrc". Some or all of those files will be 79 useful for root, any already-existing users, and new users.</para> 80 81 <para>The files from those sections that you might want to place in 82 <filename>/etc/skel</filename> include 83 <filename>.inputrc</filename>, <filename>.bash_profile</filename>, 84 <filename>.bashrc</filename>, <filename>.bash_logout</filename>, 85 <filename>.dircolors</filename>, and <filename>.vimrc</filename>. If 86 you are unsure which of these should be placed there, just continue to 87 the following sections, read each section and any references provided, 88 and then make your decision.</para> 89 90 <para>You will run a slightly modified set of commands for files which 91 are placed in <filename>/etc/skel</filename>. Each section will remind 92 you of this. In brief, the book's commands have been written for files 93 <emphasis>not</emphasis> added to <filename>/etc/skel</filename> and 94 just send the results to the user's home directory. If the file is going 95 to be in <filename>/etc/skel</filename>, change the book's command(s) to 96 send output there instead and then just copy the file from 97 <filename>/etc/skel</filename> to the appropriate directories, like 98 <filename>/etc</filename>, <filename>~</filename> or the home directoriy 99 of any other user already in the system.</para> 100 101 <para>When Adding a User</para> 102 103 <para>When adding a new user with <filename>useradd</filename> use 104 the <userinput>-m</userinput> parameter, which tells 105 <filename>useradd</filename> to create the user's home directory and 106 copy files from <filename>/etc/skel</filename> (can be overridden) to 107 the new user's home directory. For example:</para> 108 109 <para><screen><userinput>useradd -m -s/bin/bash jwrober</userinput></screen></para> 60 110 61 111 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.