1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY util-linux-download-http "https://www.kernel.org/pub/linux/utils/util-linux/v&util-linux-minor;/util-linux-&util-linux-version;.tar.xz">
|
---|
8 | <!ENTITY util-linux-download-ftp " ">
|
---|
9 | <!ENTITY util-linux-md5sum "d659bf7cd417d93dc609872f6334b019">
|
---|
10 | <!ENTITY util-linux-size "5.4 MB">
|
---|
11 | <!ENTITY util-linux-buildsize "60 MB">
|
---|
12 | <!ENTITY util-linux-time "less than 0.1 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="util-linux" xreflabel="Util-linux-&util-linux-version;">
|
---|
16 | <?dbhtml filename="util-linux.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>Util-linux-&util-linux-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="util-linux">
|
---|
22 | <primary sortas="a-Util-linux">Util-linux</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to Util-linux</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | <application>Util-linux</application> was indeed installed in LFS and
|
---|
30 | there is no reason to reinstall it unless you installed
|
---|
31 | <application>Linux-PAM</application> after your LFS system was completed.
|
---|
32 | If you have installed <application>Linux-PAM</application>,
|
---|
33 | it's possible to build <command>su</command> and
|
---|
34 | <command>runuser</command> from <application>Util-linux</application>.
|
---|
35 | The <application>Shadow</application> maintainers recommend using
|
---|
36 | <command>su</command> from <application>Util-linux</application>
|
---|
37 | instead of the version from <application>Shadow</application>.
|
---|
38 | </para>
|
---|
39 |
|
---|
40 | &lfs110a_checked;
|
---|
41 |
|
---|
42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
43 | <itemizedlist spacing="compact">
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (HTTP): <ulink url="&util-linux-download-http;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download (FTP): <ulink url="&util-linux-download-ftp;"/>
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download MD5 sum: &util-linux-md5sum;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download size: &util-linux-size;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated disk space required: &util-linux-buildsize;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated build time: &util-linux-time;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | </itemizedlist>
|
---|
75 |
|
---|
76 | <bridgehead renderas="sect3">Util-linux Dependencies</bridgehead>
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
79 | <para role="required">
|
---|
80 | <xref linkend="linux-pam"/>
|
---|
81 | </para>
|
---|
82 |
|
---|
83 | <para condition="html" role="usernotes">
|
---|
84 | User Notes: <ulink url="&blfs-wiki;/shadow"/>
|
---|
85 | </para>
|
---|
86 | </sect2>
|
---|
87 |
|
---|
88 | <sect2 role="installation">
|
---|
89 | <title>Installation of Util-linux</title>
|
---|
90 |
|
---|
91 | <important>
|
---|
92 | <para>
|
---|
93 | The installation commands shown below are for installations where
|
---|
94 | <application>Linux-PAM</application> has been installed and
|
---|
95 | <application>Util-linux</application> is being rebuilt to
|
---|
96 | support the <application>Linux-PAM</application> installation.
|
---|
97 | </para>
|
---|
98 |
|
---|
99 | <para>
|
---|
100 | If you are upgrading <application>Util-linux</application>, follow
|
---|
101 | the instruction for <application>Util-linux</application> in
|
---|
102 | <ulink url='&lfs-dev;/chapter08/util-linux.html'>LFS</ulink>. If
|
---|
103 | <application>Linux-PAM</application> has been installed,
|
---|
104 | <command>su</command> and <command>runuser</command> will
|
---|
105 | automatically be built too. You should follow
|
---|
106 | <xref linkend='pam-util-linux'/> to set up the PAM
|
---|
107 | configuration in this case.
|
---|
108 | </para>
|
---|
109 | </important>
|
---|
110 |
|
---|
111 | <para>
|
---|
112 | Build <command>su</command> and <command>runuser</command> from
|
---|
113 | <application>Util-linux</application>:
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | <screen><userinput>./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
|
---|
117 | --libdir=/usr/lib \
|
---|
118 | --docdir=/usr/share/doc/util-linux-&util-linux-version; \
|
---|
119 | --disable-chfn-chsh \
|
---|
120 | --disable-login \
|
---|
121 | --disable-nologin \
|
---|
122 | --disable-setpriv \
|
---|
123 | --disable-pylibmount \
|
---|
124 | --disable-static \
|
---|
125 | --without-python \
|
---|
126 | runstatedir=/run &&
|
---|
127 | make su runuser</userinput></screen>
|
---|
128 |
|
---|
129 | <para>
|
---|
130 | This package does not come with a test suite.
|
---|
131 | </para>
|
---|
132 |
|
---|
133 | <para>
|
---|
134 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
135 | </para>
|
---|
136 |
|
---|
137 | <screen role="root"><userinput>install -vm4755 su /usr/bin/su
|
---|
138 | install -vm0755 runuser /usr/sbin/runuser
|
---|
139 | find /usr/share/man -name su.1 -delete
|
---|
140 | install -vm0644 login-utils/{su,runuser}.1 /usr/share/man/man1</userinput></screen>
|
---|
141 |
|
---|
142 | </sect2>
|
---|
143 |
|
---|
144 | <sect2 role="commands">
|
---|
145 | <title>Command Explanations</title>
|
---|
146 |
|
---|
147 | <para>
|
---|
148 | <command>find /usr/share/man -name su.1 -delete</command>: This
|
---|
149 | is used to remove the man pages for <command>su</command> installed
|
---|
150 | from <application>Shadow</application>.
|
---|
151 | <application>Shadow</application> installs man pages with multiple
|
---|
152 | languages. They need to be removed to prevent
|
---|
153 | <command>man su</command> from picking up a translated man page
|
---|
154 | instead of <filename>/usr/share/man/man1/su.1</filename>.
|
---|
155 | </para>
|
---|
156 | </sect2>
|
---|
157 |
|
---|
158 | <sect2 role="configuration">
|
---|
159 | <title>Configuring Linux-PAM to Work with Util-linux</title>
|
---|
160 |
|
---|
161 | <sect3>
|
---|
162 | <title>Config Files</title>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | <filename>/etc/pam.d/su</filename>,
|
---|
166 | <filename>/etc/pam.d/su-l</filename>, and
|
---|
167 | <filename>/etc/pam.d/runuser</filename>
|
---|
168 | </para>
|
---|
169 |
|
---|
170 | <indexterm zone="util-linux pam.d">
|
---|
171 | <primary sortas="e-etc-pam.d-su">/etc/pam.d/su</primary>
|
---|
172 | </indexterm>
|
---|
173 |
|
---|
174 | <indexterm zone="util-linux pam.d">
|
---|
175 | <primary sortas="e-etc-pam.d-su">/etc/pam.d/su-l</primary>
|
---|
176 | </indexterm>
|
---|
177 |
|
---|
178 | <indexterm zone="util-linux pam.d">
|
---|
179 | <primary sortas="e-etc-pam.d-su">/etc/pam.d/runuser</primary>
|
---|
180 | </indexterm>
|
---|
181 | </sect3>
|
---|
182 |
|
---|
183 | <sect3 id='pam-util-linux'>
|
---|
184 | <title>Configuring the /etc/pam.d/ Files</title>
|
---|
185 |
|
---|
186 | <para>
|
---|
187 | As the <systemitem class="username">root</systemitem> user, create
|
---|
188 | the following <application>Linux-PAM</application> configuration files
|
---|
189 | in the <filename class="directory">/etc/pam.d/</filename> directory
|
---|
190 | (or add the contents to the <filename>/etc/pam.conf</filename> file)
|
---|
191 | using the following commands:
|
---|
192 | </para>
|
---|
193 |
|
---|
194 | <sect4>
|
---|
195 | <title>'su' and 'su-l'</title>
|
---|
196 |
|
---|
197 | <screen role="root"><userinput>cat > /etc/pam.d/su << "EOF"
|
---|
198 | <literal># Begin /etc/pam.d/su
|
---|
199 |
|
---|
200 | # always allow root
|
---|
201 | auth sufficient pam_rootok.so
|
---|
202 |
|
---|
203 | # Allow users in the wheel group to execute su without a password
|
---|
204 | # disabled by default
|
---|
205 | #auth sufficient pam_wheel.so trust use_uid
|
---|
206 |
|
---|
207 | # include system auth settings
|
---|
208 | auth include system-auth
|
---|
209 |
|
---|
210 | # limit su to users in the wheel group
|
---|
211 | auth required pam_wheel.so use_uid
|
---|
212 |
|
---|
213 | # include system account settings
|
---|
214 | account include system-account
|
---|
215 |
|
---|
216 | # Set default environment variables for the service user
|
---|
217 | session required pam_env.so
|
---|
218 |
|
---|
219 | # include system session settings
|
---|
220 | session include system-session
|
---|
221 |
|
---|
222 | # End /etc/pam.d/su</literal>
|
---|
223 | EOF
|
---|
224 | ln -sv su /etc/pam.d/su-l</userinput></screen>
|
---|
225 |
|
---|
226 | </sect4>
|
---|
227 |
|
---|
228 | <sect4>
|
---|
229 | <title>'runuser'</title>
|
---|
230 |
|
---|
231 | <screen role="root"><userinput>cat > /etc/pam.d/runuser << "EOF"
|
---|
232 | <literal># Begin /etc/pam.d/runuser
|
---|
233 |
|
---|
234 | auth sufficient pam_rootok.so
|
---|
235 | session include system-session
|
---|
236 |
|
---|
237 | # End /etc/pam.d/runuser</literal>
|
---|
238 | EOF</userinput></screen>
|
---|
239 |
|
---|
240 | <warning>
|
---|
241 | <para>
|
---|
242 | At this point, you should do a simple test to see if
|
---|
243 | <command>su</command> is working as expected. Open
|
---|
244 | another terminal and log in as a user, then
|
---|
245 | <command>su</command> to
|
---|
246 | <systemitem class="username">root</systemitem>.
|
---|
247 | If you do not see any errors, then all is well.
|
---|
248 | If you did receive errors, stop now and double check the
|
---|
249 | above configuration files manually. One obvious reason
|
---|
250 | for an error is if the user is not in group <systemitem
|
---|
251 | class="groupname">wheel</systemitem>. You may want to run
|
---|
252 | (as <systemitem class="username">root</systemitem>):
|
---|
253 | <command>usermod -a -G wheel
|
---|
254 | <replaceable><user></replaceable></command>.
|
---|
255 | Any other error is the sign of an error in the above
|
---|
256 | procedure. You can also run the test suite from the
|
---|
257 | <application>Linux-PAM</application> package to assist you
|
---|
258 | in determining the cause of the problem.
|
---|
259 | </para>
|
---|
260 | </warning>
|
---|
261 | </sect4>
|
---|
262 | </sect3>
|
---|
263 | </sect2>
|
---|
264 |
|
---|
265 | <sect2 role="content">
|
---|
266 | <title>Contents</title>
|
---|
267 |
|
---|
268 | <para>
|
---|
269 | Listed below are the newly installed programs along with short
|
---|
270 | descriptions.
|
---|
271 | </para>
|
---|
272 |
|
---|
273 | <segmentedlist>
|
---|
274 | <segtitle>Installed Programs</segtitle>
|
---|
275 |
|
---|
276 | <seglistitem>
|
---|
277 | <seg>
|
---|
278 | su and runuser
|
---|
279 | </seg>
|
---|
280 | </seglistitem>
|
---|
281 | </segmentedlist>
|
---|
282 |
|
---|
283 | <variablelist>
|
---|
284 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
285 | <?dbfo list-presentation="list"?>
|
---|
286 | <?dbhtml list-presentation="table"?>
|
---|
287 |
|
---|
288 | <varlistentry id="su">
|
---|
289 | <term><command>su</command></term>
|
---|
290 | <listitem>
|
---|
291 | <para>
|
---|
292 | runs a command with substitute user and group ID
|
---|
293 | </para>
|
---|
294 | <indexterm zone="util-linux su">
|
---|
295 | <primary sortas="b-su">su</primary>
|
---|
296 | </indexterm>
|
---|
297 | </listitem>
|
---|
298 | </varlistentry>
|
---|
299 |
|
---|
300 | <varlistentry id="runuser">
|
---|
301 | <term><command>runuser</command></term>
|
---|
302 | <listitem>
|
---|
303 | <para>
|
---|
304 | runs a command with substitute user and group ID; it's like
|
---|
305 | <command>su</command> but can only be used as
|
---|
306 | the <systemitem class='username'>root</systemitem> user.
|
---|
307 | </para>
|
---|
308 | <indexterm zone="util-linux runuser">
|
---|
309 | <primary sortas="b-util-linux-runuser">runuser</primary>
|
---|
310 | </indexterm>
|
---|
311 | </listitem>
|
---|
312 | </varlistentry>
|
---|
313 |
|
---|
314 | </variablelist>
|
---|
315 |
|
---|
316 | </sect2>
|
---|
317 |
|
---|
318 | </sect1>
|
---|