{"id":492,"date":"2018-10-17T14:34:29","date_gmt":"2018-10-17T14:34:29","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=492"},"modified":"2018-10-17T15:41:07","modified_gmt":"2018-10-17T15:41:07","slug":"configure-proftpd-for-sftp-on-centos","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/configure-proftpd-for-sftp-on-centos\/","title":{"rendered":"Configure ProFTPd for SFTP on CentOS"},"content":{"rendered":"<p>This is a guide on how to configure ProFTPd for SFTP sessions. Secure File Transfer Protocol (SFTP) is a secure version of FTP which transfers files via the SSH protocol. ProFTPD can be reconfigured to serve SFTP sessions vs using the default FTP protocol. This guide assumes you already have a existing ProFTPD installation. If you do not already have it installed please follow <a href=\"https:\/\/linuxadmin.io\/install-proftpd-centos\/\">How to Install Proftpd<\/a>.<\/p>\n<h2>Edit \/etc\/proftpd.conf To Enable sFTP<\/h2>\n<p>nano \/etc\/proftpd.conf<\/p>\n<p>Un-comment the following lines to load mod_sftp<\/p>\n<p>#LoadModule mod_sftp.c<br \/>\n#LoadModule mod_sftp_pam.c<\/p>\n<p>To<\/p>\n<p>LoadModule mod_sftp.c<br \/>\nLoadModule mod_sftp_pam.c<\/p>\n<p>Add the following to the end of the configuration (outside of the &lt;global&gt; &lt;\/global&gt; block to run it separately)<\/p>\n<p>&lt;IfModule mod_sftp.c&gt;<br \/>\nSFTPEngine ON<br \/>\nSFTPLog \/var\/log\/sftp.log<br \/>\nPort 2222<br \/>\nSFTPHostKey \/etc\/ssh\/ssh_host_rsa_key<br \/>\nSFTPLog \/var\/log\/proftpd\/sftp.log<br \/>\nSFTPCompression delayed<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>SFTPEngine \u2013 This will enable SFTP<br \/>\nSFTPLog \u2013 This will set the log file for sftp connections<br \/>\nPort \u2013 This will set the port ProFTPd will listen on for SFTP connections<br \/>\nSFTPHostKey \u2013 This points to the SSH key.<br \/>\nSFTPCompression \u2013 This sets the compression method used during transfers<\/p>\n<h2>Open the sFTP port in the firewall<\/h2>\n<p>Firewalld:<\/p>\n<p>Enable firewall rule:<\/p>\n<p>firewall-cmd &#8211;zone=public &#8211;add-port=2222\/tcp &#8211;permanent<\/p>\n<p>Load the new firewall<\/p>\n<p>firewall-cmd &#8211;reload<\/p>\n<p>Iptables:<\/p>\n<p>Enable the firewall rule:<\/p>\n<p>iptables -A INPUT -p tcp -m tcp &#8211;dport 2222 -j ACCEPT<\/p>\n<p>Save the firewall rule:<\/p>\n<p>iptables-save &gt; \/etc\/sysconfig\/iptables<\/p>\n<h2>Restart Proftpd<\/h2>\n<p>CentOS 7:<\/p>\n<p>systemctl restart proftpd<\/p>\n<p>CentOS 6:<\/p>\n<p>service proftpd restart<\/p>\n<p>Thats all you need to do to configure ProFTPd to accept ssh connections. You should now able to connect via port 2222 using a sFTP client.<\/p>\n<p>Jan 14, 2018LinuxAdmin.io<\/p>\n<p><a href=\"https:\/\/linuxadmin.io\/configure-proftpd-sftp-centos\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a guide on how to configure ProFTPd for SFTP sessions. Secure File Transfer Protocol (SFTP) is a secure version of FTP which transfers files via the SSH protocol. ProFTPD can be reconfigured to serve SFTP sessions vs using the default FTP protocol. This guide assumes you already have a existing ProFTPD installation. If &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/configure-proftpd-for-sftp-on-centos\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Configure ProFTPd for SFTP on CentOS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-492","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=492"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/492\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/492\/revisions\/519"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}