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 "00afd6e13bc94b2543b1a70770bdb41f">
|
---|
10 | <!ENTITY libcap-size "180 KB">
|
---|
11 | <!ENTITY libcap-buildsize "2.0 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 | &lfs112_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 | <para condition="html" role="usernotes">User Notes:
|
---|
79 | <ulink url="&blfs-wiki;/libcap"/></para>
|
---|
80 |
|
---|
81 | </sect2>
|
---|
82 |
|
---|
83 | <sect2 role="installation">
|
---|
84 | <title>Installation of libcap</title>
|
---|
85 |
|
---|
86 | <note>
|
---|
87 | <para>
|
---|
88 | If you are upgrading libcap from a previous version, use the
|
---|
89 | instructions in
|
---|
90 | <ulink url="&lfs-root;/chapter08/libcap.html">
|
---|
91 | LFS libcap page
|
---|
92 | </ulink> to upgrade libcap. If <xref linkend="linux-pam"/> has been
|
---|
93 | built, the PAM module will automatically be built too.
|
---|
94 | </para>
|
---|
95 | </note>
|
---|
96 |
|
---|
97 | <para>
|
---|
98 | Install <application>libcap</application> by running the following
|
---|
99 | commands:
|
---|
100 | </para>
|
---|
101 |
|
---|
102 | <screen><userinput>make -C pam_cap</userinput></screen>
|
---|
103 |
|
---|
104 | <para>
|
---|
105 | This package does not come with a test suite.
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <para>
|
---|
109 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
110 | </para>
|
---|
111 |
|
---|
112 | <screen role="root"><userinput>install -v -m755 pam_cap/pam_cap.so /usr/lib/security &&
|
---|
113 | install -v -m644 pam_cap/capability.conf /etc/security</userinput></screen>
|
---|
114 |
|
---|
115 | </sect2>
|
---|
116 |
|
---|
117 | <sect2 role="configuration">
|
---|
118 | <title>Configuring Libcap</title>
|
---|
119 |
|
---|
120 | <para>
|
---|
121 | In order to allow <application>Linux-PAM</application> to grant
|
---|
122 | privileges based on POSIX capabilities, you need to add the libcap module
|
---|
123 | to the beginning of the <filename>/etc/pam.d/system-auth</filename> file.
|
---|
124 | Make the required edits with the following commands:
|
---|
125 | </para>
|
---|
126 |
|
---|
127 | <screen role="root"><userinput>mv -v /etc/pam.d/system-auth{,.bak} &&
|
---|
128 | cat > /etc/pam.d/system-auth << "EOF" &&
|
---|
129 | <literal># Begin /etc/pam.d/system-auth
|
---|
130 |
|
---|
131 | auth optional pam_cap.so</literal>
|
---|
132 | EOF
|
---|
133 | tail -n +3 /etc/pam.d/system-auth.bak >> /etc/pam.d/system-auth</userinput></screen>
|
---|
134 |
|
---|
135 | <para>
|
---|
136 | Additionally, you'll need to modify the
|
---|
137 | <filename>/etc/security/capability.conf</filename> file to grant
|
---|
138 | necessary privileges to users, and utilize the <command>setcap</command>
|
---|
139 | utility to set capabilities on specific utilities as needed. See
|
---|
140 | <command>man 8 setcap</command> and
|
---|
141 | <command>man 3 cap_from_text</command> for additional information.
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | </sect2>
|
---|
145 |
|
---|
146 | <sect2 role="content">
|
---|
147 | <title>Contents</title>
|
---|
148 |
|
---|
149 | <segmentedlist>
|
---|
150 | <segtitle>Installed Programs</segtitle>
|
---|
151 | <segtitle>Installed Library</segtitle>
|
---|
152 | <segtitle>Installed Directories</segtitle>
|
---|
153 |
|
---|
154 | <seglistitem>
|
---|
155 | <seg>None</seg>
|
---|
156 | <seg>pam_cap.so</seg>
|
---|
157 | <seg>None</seg>
|
---|
158 | </seglistitem>
|
---|
159 | </segmentedlist>
|
---|
160 |
|
---|
161 | </sect2>
|
---|
162 |
|
---|
163 | </sect1>
|
---|