Excellent instructions, works great, here are my notes. Let me say up front I have two questions about ProFtpd SFTP also:
1. Does /usr/local/directadmin/data/templates/proftpd.vhosts.conf
need to be empty ? See below.
2. Does the firewall need to allow UDP and MESSENGER_TEXT_IN ?
Code:
# find /usr/local/directadmin/ -name options.conf
/usr/local/directadmin/custombuild/options.conf
As a DirectAdmin newbie I need to know where these things are.
After "./build proftp" Jeff syas you want this so it will survive a reboot:
Code:
# cd /etc/rc.d/rc3.d/
# ls -ald *ftp* --color=no
lrwxrwxrwx 1 root root 19 Nov 8 12:20 K15pure-ftpd -> ../init.d/pure-ftpd
lrwxrwxrwx 1 root root 17 Nov 8 12:20 S85proftpd -> ../init.d/proftpd
Thanks for including that step. Mine indeed was not correct for some reason. Did I build before I edited options.conf ? Fix:
Code:
# mv S85pure-ftpd K15pure-ftpd
# mv K15proftpd S85proftpd
# ls -ald *ftp* --color=no
Code:
# ps waux | grep ftp | grep -v grep
Note, you will also see any active SFTP connections using the SSH port. That's the simple DA way of doing SFTP, for users with shell privileges.
Code:
root 10077 0.0 0.1 8228 1804 ? Ss 07:42 0:00 /usr/libexec/openssh/sftp-server
ftp 31585 0.0 0.2 16580 3188 ? SLs 09:11 0:00 proftpd: (accepting connections)
root 32648 0.0 0.1 8220 1724 ? Ss 09:31 0:00 /usr/libexec/openssh/sftp-server
SFTP
Probably like other people reading this, I'm switching to ProFtp in order to get SFTP working for users without shell. So I'll include my notes on that. The module and instructions were first posted here on the forums in 2009 by Rootbsd and became this help article:
http://help.directadmin.com/item.php?id=439
Before step 1 is this requirement:
This assumes you're using the newer unified_ftp_password_file setup for proftpd (you should have an empty proftpd.vhosts.conf file)
The detailed instructions for
that are at
http://www.directadmin.com/features.php?id=1134 but here's a quick check.
Code:
# cd /usr/local/directadmin
# grep -r --include=*.conf unified_ftp .
./data/templates/directadmin.conf:unified_ftp_password_file=1
./conf/directadmin.conf:unified_ftp_password_file=1
So it's on, yet proftpd.vhosts.conf is not empty:
Code:
# find / -name proftpd.vhosts.conf -ls
14550497 0 -rw-r--r-- 1 root root 0 May 19 05:34 /etc/proftpd.vhosts.conf
14681526 4 -rw-r--r-- 1 diradmin diradmin 147 May 18 18:24 /usr/local/directadmin/data/templates/proftpd.vhosts.conf
One is empty, one is not. Is something bad going to happen next time I restart DirectAdmin or rebuild it? Don't know.
Next is "Step 1" in the help article: activate TJ Saunders's
mod_sftp plugin for ProFtpd. Do that by wget'ting the config from files1.directadmin.com and building.
Step 2 is putting your IP in the config files.
Step 3 is restarting proftpd and checking it via "telnet localhost 23".
Firewall
Port 23 was blocked (except localhost) so I looked at the csf firewall controlled by the DirectAdmin GUI, at DirectAdmin / Admin / ConfigServer Security & Firewall ( CMD_PLUGINS_ADMIN/csf/index.html ).
I searched for 21 and added ",23" everywhere I saw it:
Code:
TCP_IN
TCP_OUT
UDP_IN
UDP_OUT
TCP6_IN
TCP6_OUT
UDP6_IN
UDP6_OUT
MESSENGER_TEXT_IN
The UDP's and MESSENGER_TEXT_IN may not be needed ?
Change Port
Port 23 is actually the default telnet port. I guess whoever chose it knew there wouldn't be a telnetd listener on a DA server? And if they chose a 4-digit port there was a chance of a conflict. Or they pictured different firewall rules.
I decided to change 23 to an unused 4-digit port. So I edited:
and the firewall rules in DA and restarted proftpd.