• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Configure ProFTPd for SFTP on CentOS

Configure Proftpd for sFTP

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 How to Install Proftpd.

Edit /etc/proftpd.conf  To Enable sFTP

nano /etc/proftpd.conf

Un-comment the following lines to load mod_sftp

#LoadModule mod_sftp.c
#LoadModule mod_sftp_pam.c

To

LoadModule mod_sftp.c
LoadModule mod_sftp_pam.c

Add the following to the end of the configuration (outside of the <global> </global> block to run it separately)

<IfModule mod_sftp.c>
 SFTPEngine ON
 SFTPLog /var/log/sftp.log
 Port 2222
 SFTPHostKey /etc/ssh/ssh_host_rsa_key
 SFTPLog /var/log/proftpd/sftp.log
 SFTPCompression delayed
</IfModule>

SFTPEngine – This will enable SFTP
SFTPLog – This will set the log file for sftp connections
Port – This will set the port ProFTPd will listen on for SFTP connections
SFTPHostKey – This points to the SSH key.
SFTPCompression – This sets the compression method used during transfers

Open the sFTP port in the firewall

Firewalld:

Enable firewall rule:

firewall-cmd --zone=public --add-port=2222/tcp --permanent

Load the new firewall

firewall-cmd --reload

Iptables:

Enable the firewall rule:

iptables -A INPUT -p tcp -m tcp --dport 2222 -j ACCEPT

Save the firewall rule:

iptables-save > /etc/sysconfig/iptables

 

Restart Proftpd

CentOS 7:

systemctl restart proftpd

CentOS 6:

service proftpd restart

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.

Jan 14, 2018LinuxAdmin.io
5 1 vote
Article Rating
How To Check And Repair MyISAM Tables In MySQLOSSEC Intrusion Detection Installation On Centos 7
You Might Also Like
 
How To Setup mod_rewrite In Apache
 
FFMpeg Install On CentOS 7
Subscribe
Notify of
guest
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Daniels
Daniels
4 years ago

firewall-cmd command not found Centos 6

0
Reply
LinuxAdmin.io
Author
LinuxAdmin.io
4 years ago
Reply to  Daniels

Hello,
If you are running a firewall on Centos 6, it would likely be iptables? If so, please utilize the commands for iptables instead of firewalld

0
Reply
5 years ago 2 Comments Linux System Administration 10,226
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
62,997 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,912 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz