~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_pam/docs/index.rst

  • Committer: Daniel Nichter
  • Date: 2011-10-23 17:35:00 UTC
  • mfrom: (2441.1.1 drizzle-docs71)
  • mto: This revision was merged to the branch mainline in revision 2448.
  • Revision ID: daniel@percona.com-20111023173500-g62gefh9l2cbcom0
Merge lp:~hingo/drizzle/drizzle-docs71 at r2442 and reformat auth_pam doc a little.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
PAM Authenication
4
4
=================
5
5
 
6
 
:program:`auth_pam` is an authentication plugin that authentication connections
7
 
using :abbr:`PAM (Pluggable Authentication Module)`.
8
 
PAM is effectively your current Linux based user security. [1]_ 
 
6
:program:`auth_pam` is an authentication plugin that authenticates connections
 
7
using :abbr:`PAM (Pluggable Authentication Module)`. PAM is effectively your 
 
8
current Linux based user security. This means you can setup Drizzle so that you 
 
9
can use your Linux system username and password to connect. System user and 
 
10
password files are typically stored in files ``/etc/passwd`` and 
 
11
``/etc/shadow``. However, PAM can also be setup to use other sources, such as an 
 
12
LDAP directory, as a user database. All of these options are transparently 
 
13
available to Drizzle via this module.
9
14
 
10
15
.. note:: Unload the :doc:`/plugins/auth_all/index` plugin before using this plugin.
11
16
.. seealso:: :doc:`/administration/authentication` 
19
24
 
20
25
   --plugin-add=auth_pam
21
26
 
22
 
Loading the plugin may not enable or configure it.  See the plugin's
23
 
:ref:`auth_pam_configuration` and :ref:`auth_pam_variables`.
 
27
Or, to disable the ability to login without a password, use::
 
28
 
 
29
   --plugin-add=auth_pam --plugin-remove=auth_all
24
30
 
25
31
.. seealso:: :ref:`drizzled_plugin_options` for more information about adding and removing plugins.
26
32
 
43
49
Examples
44
50
--------
45
51
 
46
 
Sorry, there are no examples for this plugin.
 
52
Most Linux distributions should have PAM configured in a way that it will just
 
53
work with Drizzle.  The default PAM configuration is typically found in
 
54
:file:`/etc/pam.d/other`. [1]_ However, if you want to  specifically configure
 
55
the way PAM will be used by Drizzle, then put something like the following
 
56
in :file:`/etc/pam.d/drizzle`:
 
57
 
 
58
.. code-block:: ini
 
59
 
 
60
   auth       required     pam_unix.so
 
61
   account    required     pam_unix.so
 
62
 
 
63
To enable auth_pam, start Drizzle like:
 
64
 
 
65
.. code-block:: bash
 
66
 
 
67
   $ sbin/drizzled --plugin-remove=auth_all --plugin-add=auth_pam
 
68
 
 
69
As an alternative to using command line options, you can enable auth_pam
 
70
by adding the following to :file:`/etc/drizzle/drizzled.cnf`:
 
71
 
 
72
.. code-block:: ini
 
73
 
 
74
   plugin-remove=auth_all
 
75
   plugin-add=auth_pam
 
76
 
 
77
Then connect to Drizzle like:
 
78
 
 
79
.. code-block:: bash
 
80
 
 
81
   $ bin/drizzle -P --protocol mysql-plugin-auth
 
82
   Enter password: [Enter your system password here]
 
83
 
 
84
   Welcome to the Drizzle client..  Commands end with ; or \g.
 
85
   Your Drizzle connection id is 3
 
86
   Connection protocol: mysql-plugin-auth
 
87
   Server version: 2011.09.26.2426 Source distribution (drizzle-docs71)
 
88
 
 
89
   Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
90
   
 
91
   drizzle> 
 
92
 
 
93
You must use ``--protocol mysql-plugin-auth`` for auth_pam to work. This 
 
94
protocol sends the password in plaintext to Drizzle, which
 
95
is required for PAM based authentication.
 
96
 
 
97
Note that you don't need to specify the ``-u`` or ``--user`` argument, since
 
98
Drizzle will default to using your system username, which is exactly what we
 
99
want when using auth_pam.
 
100
 
 
101
.. _auth_pam_security:
 
102
 
 
103
Security
 
104
--------
 
105
 
 
106
When using auth_pam, your Drizzle password is sent unencrypted from the client 
 
107
to the server. See :ref:`auth_pam_limitations` for details.
 
108
Note that this will almost always be your Linux system password too!
 
109
 
 
110
Arguably, this is not a problem when you are connecting to Drizzle from
 
111
localhost and sharing your system username and password for Drizzle can
 
112
be quite convenient. 
 
113
 
 
114
.. warning:: Using auth_pam when connecting over a public or insecure network is strongly discouraged!
 
115
 
 
116
We recommend you disable auth_pam on networked Drizzle servers
 
117
and instead use the :ref:`auth_schema_plugin` plugin or alternatively
 
118
the :ref:`auth_ldap_plugin` plugin if you are interested in managing
 
119
usernames outside of Drizzle.
 
120
 
 
121
.. _auth_pam_limitations:
 
122
 
 
123
Limitations
 
124
-----------
 
125
 
 
126
Most Drizzle authentication plugins will use a challenge-response protocol
 
127
for authentication. In such schemes the client and the server each compute a 
 
128
hash that they compare with each other. Thanks to this, the password itself is
 
129
never sent over the network and therefore cannot be seen by an eavesdropping
 
130
attacker. The auth_pam plugin however needs to use the password in plaintext
 
131
format. This limitation is due to the typical configuration of PAM. For 
 
132
instance, also when you log in via SSH to your system, the password is sent in 
 
133
plaintext from the client to the server. Of course, in the case of SSH the 
 
134
communication channel itself is encrypted, so it cannot be eavesdropped.
 
135
 
 
136
Which leads us to the next limitation: the :ref:`drizzle_command_line_client`
 
137
does not support SSL connections. This means communication between client and server
 
138
is sent in unencrypted cleartext over the network, including your password. 
 
139
Hopefully a future version of the :ref:`drizzle_command_line_client` will support SSL 
 
140
encrypted connections, making auth_pam authentication more useful.
 
141
 
 
142
You must use the following parameters to the :ref:`drizzle_command_line_client`
 
143
to make sure your password is sent in plaintext to the server:
 
144
 
 
145
.. code-block:: bash
 
146
 
 
147
   $ drizzle -P --protocol mysql-plugin-auth
 
148
 
 
149
The ``-P`` or ``--password`` switch will make :program:`drizzle` ask for your
 
150
password  interactively. The ``--protocol mysql-plugin-auth`` will use a
 
151
protocol that sends the password in plaintext.
47
152
 
48
153
.. _auth_pam_authors:
49
154
 
50
155
Authors
51
156
-------
52
157
 
53
 
Brian Aker
 
158
:Code: Brian Aker
 
159
:Documentation: Henrik Ingo, Daniel Nichter
54
160
 
55
161
.. _auth_pam_version:
56
162
 
76
182
 
77
183
.. rubric:: Footnotes
78
184
 
79
 
.. [1] `Understanding Drizzle user authentication options – Part 1 <http://ronaldbradford.com/blog/understanding-drizzle-authentication-options-part-1-2010-03-12/>`_
 
185
.. [1] For more details about configuring PAM, see `The Linux Documentation Project: User Authentication HOWTO <http://tldp.org/HOWTO/User-Authentication-HOWTO/x263.html>`_
80
186