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 libcap-download-http "&kernel-dl;/linux/libs/security/linux-privs/libcap2/libcap-&libcap-version;.tar.xz">
|
---|
8 | <!ENTITY libcap-download-ftp " ">
|
---|
9 | <!ENTITY libcap-md5sum "4667bacb837f9ac4adb4a1a0266f4b65">
|
---|
10 | <!ENTITY libcap-size "188 KB">
|
---|
11 | <!ENTITY libcap-buildsize "2.2 MB">
|
---|
12 | <!ENTITY libcap-time "less than 0.1 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="libcap-pam" xreflabel="libcap-&libcap-version; with PAM">
|
---|
16 | <?dbhtml filename="libcap.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>libcap-&libcap-version; with PAM</title>
|
---|
20 |
|
---|
21 | <indexterm zone="libcap-pam">
|
---|
22 | <primary sortas="a-libcap-pam">libcap</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to libcap with PAM</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | The <application>libcap</application> package was installed in
|
---|
30 | LFS, but if <application>Linux-PAM</application> support is desired,
|
---|
31 | the PAM module must be built (after installation of
|
---|
32 | <application>Linux-PAM</application>).
|
---|
33 | </para>
|
---|
34 |
|
---|
35 | &lfs120_checked;
|
---|
36 |
|
---|
37 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
38 | <itemizedlist spacing="compact">
|
---|
39 | <listitem>
|
---|
40 | <para>
|
---|
41 | Download (HTTP): <ulink url="&libcap-download-http;"/>
|
---|
42 | </para>
|
---|
43 | </listitem>
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (FTP): <ulink url="&libcap-download-ftp;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download MD5 sum: &libcap-md5sum;
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download size: &libcap-size;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Estimated disk space required: &libcap-buildsize;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated build time: &libcap-time;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | </itemizedlist>
|
---|
70 |
|
---|
71 | <bridgehead renderas="sect3">libcap Dependencies</bridgehead>
|
---|
72 |
|
---|
73 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
74 | <para role="required">
|
---|
75 | <xref linkend="linux-pam"/>
|
---|
76 | </para>
|
---|
77 |
|
---|
78 |
|
---|
79 | </sect2>
|
---|
80 |
|
---|
81 | <sect2 role="installation">
|
---|
82 | <title>Installation of libcap</title>
|
---|
83 |
|
---|
84 | <note>
|
---|
85 | <para>
|
---|
86 | If you are upgrading libcap from a previous version, use the
|
---|
87 | instructions in
|
---|
88 | <ulink url="&lfs-root;/chapter08/libcap.html">
|
---|
89 | LFS libcap page
|
---|
90 | </ulink> to upgrade libcap. If <xref linkend="linux-pam"/> has been
|
---|
91 | built, the PAM module will automatically be built too.
|
---|
92 | </para>
|
---|
93 | </note>
|
---|
94 |
|
---|
95 | <para>
|
---|
96 | Install <application>libcap</application> by running the following
|
---|
97 | commands:
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <screen><userinput>make -C pam_cap</userinput></screen>
|
---|
101 |
|
---|
102 | <para>
|
---|
103 | This package does not come with a test suite.
|
---|
104 | </para>
|
---|
105 |
|
---|
106 | <para>
|
---|
107 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
108 | </para>
|
---|
109 |
|
---|
110 | <screen role="root"><userinput>install -v -m755 pam_cap/pam_cap.so /usr/lib/security &&
|
---|
111 | install -v -m644 pam_cap/capability.conf /etc/security</userinput></screen>
|
---|
112 |
|
---|
113 | </sect2>
|
---|
114 |
|
---|
115 | <sect2 role="configuration">
|
---|
116 | <title>Configuring Libcap</title>
|
---|
117 |
|
---|
118 | <para>
|
---|
119 | In order to allow <application>Linux-PAM</application> to grant
|
---|
120 | privileges based on POSIX capabilities, you need to add the libcap module
|
---|
121 | to the beginning of the <filename>/etc/pam.d/system-auth</filename> file.
|
---|
122 | Make the required edits with the following commands:
|
---|
123 | </para>
|
---|
124 |
|
---|
125 | <screen role="root"><userinput>mv -v /etc/pam.d/system-auth{,.bak} &&
|
---|
126 | cat > /etc/pam.d/system-auth << "EOF" &&
|
---|
127 | <literal># Begin /etc/pam.d/system-auth
|
---|
128 |
|
---|
129 | auth optional pam_cap.so</literal>
|
---|
130 | EOF
|
---|
131 | tail -n +3 /etc/pam.d/system-auth.bak >> /etc/pam.d/system-auth</userinput></screen>
|
---|
132 |
|
---|
133 | <para>
|
---|
134 | Additionally, you'll need to modify the
|
---|
135 | <filename>/etc/security/capability.conf</filename> file to grant
|
---|
136 | necessary privileges to users, and utilize the <command>setcap</command>
|
---|
137 | utility to set capabilities on specific utilities as needed. See
|
---|
138 | <command>man 8 setcap</command> and
|
---|
139 | <command>man 3 cap_from_text</command> for additional information.
|
---|
140 | </para>
|
---|
141 |
|
---|
142 | </sect2>
|
---|
143 |
|
---|
144 | <sect2 role="content">
|
---|
145 | <title>Contents</title>
|
---|
146 |
|
---|
147 | <segmentedlist>
|
---|
148 | <segtitle>Installed Programs</segtitle>
|
---|
149 | <segtitle>Installed Library</segtitle>
|
---|
150 | <segtitle>Installed Directories</segtitle>
|
---|
151 |
|
---|
152 | <seglistitem>
|
---|
153 | <seg>None</seg>
|
---|
154 | <seg>pam_cap.so</seg>
|
---|
155 | <seg>None</seg>
|
---|
156 | </seglistitem>
|
---|
157 | </segmentedlist>
|
---|
158 |
|
---|
159 | </sect2>
|
---|
160 |
|
---|
161 | </sect1>
|
---|