// <ahref="./index.html">Document Index</a></div><h1id="install-pure-ftpd-with-openldap-backend-on-rhelcentos">Install Pure-FTPd with OpenLDAP backend on RHEL/CentOS</h1>
<h2id="add-ldap-ftp-attributes-and-values-for-new-user">Add LDAP FTP attributes and values for new user</h2>
<p>use the iredmail tools quick create the user include the PureFTP attributes and values.</p>
<ul>
<li>Open <code>/iRedMail-x.y.z/tools/create_mail_user_OpenLDAP.sh</code> and set correct values:</li>
</ul>
<pre><code>LDAP_SUFFIX="dc=example,dc=com" # <- Change the LDAP suffix
BINDPW='passwd' # <- Password for the bind dn `cn=Manager,dc=example,dc=com`
PUREFTPD_INTEGRATION='YES' # <- Change to YES, enable the pureftp inteegration
</code></pre>
<ul>
<li>Run the script to create a new user <code>user1@example.com</code>. The default password is same as user name (<code>user1</code>) by default.</li>
<p>iRedMail doesn't open port 20 and 21 by default, you must open them first.</p>
<ul>
<li>Open <code>/etc/sysconfig/iptables</code> and set correct values:</li>
</ul>
<pre><code>-A INPUT -p tcp --dport 20 -j ACCEPT
-A INPUT -p tcp --dport 21 -j ACCEPT
</code></pre>
<ul>
<li>Restart the iptables service</li>
</ul>
<pre><code># /etc/init.d/iptables restart
</code></pre>
<h2id="testing">Testing</h2>
<p>You can use windows FTP client or Linux ftp client (e.g. command line ftp client <code>lftp</code> or GUI client <code>FileZilla</code>) for testing.</p>
<pre><code>$ lftp localhost
localhost:~> debug 4
localhost:~> login user1@example.com user1 # <-- input the username and password
user1@example.com@localhost:~> ls
---- Connecting to localhost (127.0.0.1) port 21
<--- 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
<--- 220-You are user number 1 of 50 allowed.
<--- 220-Local time is now 16:25. Server port: 21.
<--- 220-IPv6 connections are also welcome on this server.
<--- 220 You will be disconnected after 15 minutes of inactivity.
<p>If you need to debug OpenLDAP, please refer to another document: <ahref="./debug.openldap.html">Debug OpenLDAP</a>.</p><pstyle="text-align: center; color: grey;">All documents are available in <ahref="https://bitbucket.org/zhb/iredmail-docs/src">BitBucket repository</a>, and published under <ahref="http://creativecommons.org/licenses/by-nd/3.0/us/"target="_blank">Creative Commons</a> license. If you found something wrong, please do <ahref="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>