Using VirtualHosts on a ProFTPd server

When using ProFTPd you may want to have the server listening on different ports, for example if you want to use FTP and SFTP at the same time. Here is an example: <VirtualHost ftp.example.net> SFTPEngine off Port 21 DefaultRoot ~ Umask 022 022 AllowOverwrite on </VirtualHost> <VirtualHost sftp.example.net> SFTPEngine on Port 2222 SFTPLog […]

Installing ProFTPd with Public Key Authentication on Ubuntu 16.04

First install proftpd: apt-get update apt-get install proftpd Next, change the following lines in /etc/proftpd/proftpd.conf: ServerName "sftp.example.net" DefaultRoot ~ Put in your hostname (if it resolves) or IP address as ServerName. The second line will jail the user to his home directory. Next, create the file /etc/proftpd/conf.d/sftp.conf with the following content: <IfModule mod_sftp.c> SFTPEngine on # If […]

Using Debian behind a Proxy

If you are using Debian behind a proxy (e.g. Squid), you just have to declare the following environment variables to use it: export HTTP_PROXY=[IP]:[PORT] export HTTPS_PROXY=[IP]:[PORT] export FTP_PROXY=[IP]:[PORT] An example for [IP]:[PORT] could be In order to stay persistent, you could add the above commands to ~/.profile or /etc/bash.bashrc for example.

Copy a remote folder via FTP on the Linux command line using lftp

Install lftp using apt-get install lftp To start off with connect to the FTP server: lftp Login to the FTP server via lftp: lftp> user yourusername Password: (Enter your password) As soon as you are logged in, you can list the remote folders using ls, list all available commands via help Let's assume […]

Installing PureFTPd with MySQL Backend on Gentoo

The FTP accounts will be stored in a mysql database table.  First let's install pureftpd: USE="pam ssl mysql" emerge pure-ftpd Once the installation is finished, there are 2 main configuration files in /etc/conf.d:   /etc/conf.d/pure-ftpd IS_CONFIGURED="yes" # the server won't start up if set to "no" SERVER="-S 21" # server port MAX_CONN="-c 30" # maximum number […]

ProFTPd with MySQL Backend on Debian

First of all we install the needed packages: apt-get install proftpd proftpd-mysql mysql-server The configuration files of the proftpd server are in /etc/proftpd.   First we edit the file /etc/proftpd/modules.conf and insert/uncomment the following lines: LoadModule mod_sql.c LoadModule mod_sql_mysql.c   Then we should create the mysql database and the table that will contain the proftpd users: CREATE DATABASE […]

SFTP Server with chroot on Debian

On Debian Etch, if you want to have a chroot'ed environment, a simple way to implement this is using mySecureShell. First we need to install some dependancies: apt-get install libssl0.9.7 ssh openssh-server   Then we install mySecureShell itself: wget https://www.devops.zone/wp-content/uploads/attachments/mysecureshell_0.95_i386.deb dpkg -i mysecureshell_0.95_i386.deb Now, to activate the new shell for a user, to have to modify the […]