| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_sftp_pam</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_sftp_pam</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | The <code>mod_sftp_pam</code> module provides support for the "SSH Keyboard-Interactive Authentication" RFC (<a href="http://www.faqs.org/rfcs/rfc4256.html">RFC4256</a>). How is <code>mod_sftp_pam</code> different from ProFTPD's existing |
| 17 | PAM support, in the form of <code>mod_auth_pam</code>? The difference is |
| 18 | that the <code>mod_auth_pam</code> module does <b>not</b> echo the prompt, |
| 19 | provided by the underlying PAM library/modules, back to the FTP client; |
| 20 | this <code>mod_sftp_pam</code> module will echo any prompt back to the |
| 21 | connecting SSH2 client. This makes using onetime-password PAM modules, for |
| 22 | example, work very easily for authenticating SSH2 logins. |
| 23 | |
| 24 | <p> |
| 25 | This module is contained in the <code>mod_sftp_pam.c</code> file for |
| 26 | ProFTPD 1.3.<i>x</i>, and is not compiled by default. Installation |
| 27 | instructions are discussed <a href="#Installation">here</a>; a discussion |
| 28 | on <a href="#Usage">usage</a> is also available. |
| 29 | |
| 30 | <p> |
| 31 | The most current version of <code>mod_sftp_pam</code> is distributed with the |
| 32 | ProFTPD source code. |
| 33 | |
| 34 | <h2>Author</h2> |
| 35 | <p> |
| 36 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 37 | questions, concerns, or suggestions regarding this module. |
| 38 | |
| 39 | <h2>Directives</h2> |
| 40 | <ul> |
| 41 | <li><a href="#SFTPPAMEngine">SFTPPAMEngine</a> |
| 42 | <li><a href="#SFTPPAMOptions">SFTPPAMOptions</a> |
| 43 | <li><a href="#SFTPPAMServiceName">SFTPPAMServiceName</a> |
| 44 | </ul> |
| 45 | |
| 46 | <hr> |
| 47 | <h3><a name="SFTPPAMEngine">SFTPPAMEngine</a></h3> |
| 48 | <strong>Syntax:</strong> SFTPPAMEngine <em>on|off</em><br> |
| 49 | <strong>Default:</strong> On<br> |
| 50 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 51 | <strong>Module:</strong> mod_sftp_pam<br> |
| 52 | <strong>Compatibility:</strong> 1.3.2rc2 and later |
| 53 | |
| 54 | <p> |
| 55 | The <code>SFTPPAMEngine</code> directive toggles the use of the PAM library |
| 56 | for supporting a keyboard-interactive authentication mechanism for SSH2 logins. |
| 57 | By default <code>mod_sftp_pam</code> is enabled. |
| 58 | |
| 59 | <p> |
| 60 | <hr> |
| 61 | <h3><a name="SFTPPAMOptions">SFTPPAMOptions</a></h3> |
| 62 | <strong>Syntax:</strong> SFTPPAMOptions <em>opt1 opt2 ... optN</em><br> |
| 63 | <strong>Default:</strong> None<br> |
| 64 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 65 | <strong>Module:</strong> mod_sftp_pam<br> |
| 66 | <strong>Compatibility:</strong> 1.3.2rc2 and later |
| 67 | |
| 68 | <p> |
| 69 | The <code>SFTPPAMOptions</code> directive is used to configure various |
| 70 | optional behaviors of <code>mod_sftp_pam</code>; it is directly analogous |
| 71 | to <code>mod_auth_pam</code>'s <code>AuthPAMOptions</code> directive. |
| 72 | |
| 73 | <p> |
| 74 | The currently supported options are: |
| 75 | <ul> |
| 76 | <li><code>NoTTY</code> |
| 77 | </li> |
| 78 | |
| 79 | <p> |
| 80 | <li><code>NoInfoMsgs</code> |
| 81 | <p> |
| 82 | Disables the sending of information messages from PAM to the connecting |
| 83 | SSH client. This option is usually used for compatibility with |
| 84 | OpenSSH's behavior. |
| 85 | </li> |
| 86 | |
| 87 | <p> |
| 88 | <li><code>NoRadioMsgs</code> |
| 89 | <p> |
| 90 | Disables the sending of Linux-specific information messages from PAM |
| 91 | (usually from the <code>pam_winbind</code> PAM module) to the connecting |
| 92 | SSH client. This option is usually used for compatibility with |
| 93 | OpenSSH's behavior. |
| 94 | </li> |
| 95 | </ul> |
| 96 | |
| 97 | <p> |
| 98 | <hr> |
| 99 | <h3><a name="SFTPPAMServiceName">SFTPPAMServiceName</a></h3> |
| 100 | <strong>Syntax:</strong> SFTPPAMServiceName <em>service</em><br> |
| 101 | <strong>Default:</strong> SFTPPAMServiceName sshd<br> |
| 102 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 103 | <strong>Module:</strong> mod_sftp_pam<br> |
| 104 | <strong>Compatibility:</strong> 1.3.2rc2 and later |
| 105 | |
| 106 | <p> |
| 107 | The <code>SFTPPAMConfig</code> directive is used to specify the name of the |
| 108 | service used when performing the PAM check; PAM configurations can vary |
| 109 | depending on the service. By default, the "sshd" service is used. |
| 110 | |
| 111 | <p> |
| 112 | Here's an example of changing the <em>service</em> used: |
| 113 | <pre> |
| 114 | <IfModule mod_sftp_pam.c> |
| 115 | SFTPPAMEngine on |
| 116 | SFTPPAMServiceName ftpd |
| 117 | </IfModule> |
| 118 | </pre> |
| 119 | |
| 120 | <p> |
| 121 | The <code>SFTPPAMServiceName</code> directive is directly analogous to |
| 122 | <code>mod_auth_pam</code>'s <code>AuthPAMConfig</code> directive. |
| 123 | |
| 124 | <p> |
| 125 | <hr> |
| 126 | <h2><a name="Installation">Installation</a></h2> |
| 127 | The <code>mod_sftp_pam</code> module is distributed with ProFTPD. Simply follow |
| 128 | the normal steps for using third-party modules in ProFTPD: |
| 129 | <pre> |
| 130 | $ ./configure --with-modules=mod_sftp:mod_sftp_pam ... |
| 131 | $ make |
| 132 | $ make install |
| 133 | </pre> |
| 134 | Alternatively, <code>mod_sftp_pam</code> can be built as a DSO module: |
| 135 | <pre> |
| 136 | $ ./configure --enable-dso --with-shared=mod_sftp_pam ... |
| 137 | </pre> |
| 138 | Then follow the usual steps: |
| 139 | <pre> |
| 140 | $ make |
| 141 | $ make install |
| 142 | </pre> |
| 143 | |
| 144 | <p> |
| 145 | For those with an existing ProFTPD installation, you can use the |
| 146 | <code>prxs</code> tool to add <code>mod_sftp_pam</code>, as a DSO module, to |
| 147 | your existing server: |
| 148 | <pre> |
| 149 | $ prxs -c -i -d mod_sftp_pam.c |
| 150 | </pre> |
| 151 | |
| 152 | <p> |
| 153 | <hr><br> |
| 154 | <h2><a name="Usage">Usage</a></h2> |
| 155 | To use <code>mod_sftp_pam</code>, simply configure it to use the correct PAM |
| 156 | service name, <i>e.g.</i>: |
| 157 | <pre> |
| 158 | <IfModule mod_sftp_pam.c> |
| 159 | SFTPPAMEngine on |
| 160 | SFTPPAMServiceName sftp |
| 161 | </IfModule> |
| 162 | </pre> |
| 163 | There is no requirement that <code>mod_sftp_pam</code> use the same PAM |
| 164 | service name as the <code>mod_auth_pam</code> module; this allows you to have |
| 165 | different PAM configurations for FTP versus SSH2 logins. |
| 166 | |
| 167 | <p> |
| 168 | <hr> |
| 169 | <font size=2><b><i> |
| 170 | © Copyright 2008-2013 TJ Saunders<br> |
| 171 | All Rights Reserved<br> |
| 172 | </i></b></font> |
| 173 | <hr> |
| 174 | |
| 175 | </body> |
| 176 | </html> |