SETUP VSFTPD FOR LINUX ON AZURE

Ubuntu Linux virtual machines have FTP available however that does not provide remote file transfer, WinSCP or Filezilla can handle the Windows client requirements. Remember to open the FPT port 21 in the Azure firewall. There is a preset for FTP on Azure which is all you need.

Azure also by default already has the SSL port 22 open and installed with their Linux virtual machine. This post assumes you are using localhost.

sudo apt-get install openssl

sudo apt-get install libssl-dev

sudo apt-get install vsftpd

sudo mkdir /home/ftp

sudo chmod a-w /home/ftp

by default vsftpd does not work with Azure so its necessary to use a custom settings file.

sudo nano /etc/vsftpd.conf

#anonymous_enable=YES
#set the local root to whatever the FTP will be using for transfers
ascii_download_enable=NO
ascii_upload_enable=NO
chown_uploads=NO
connect_from_port_20=YES
dirmessage_enable=YES
file_open_mode=0666
ftpd_banner=Welcome to LAMP FTP server on Microsoft Azure.
listen=YES
local_enable=YES
local_root=/home/ftp
local_umask=0022
log_ftp_protocol=YES
ls_recurse_enable=NO
pam_service_name=vsftpd
pasv_addr_resolve=NO
pasv_enable=YES
pasv_max_port=60002
pasv_min_port=60001
port_enable=YES
rsa_cert_file=/etc/ssl/private/vsftpd.pem
use_localtime=YES
write_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO

once the settings are good restart vsftpd

sudo service vsftpd restart

Now that the server is configured, you can now connect with FileZilla using the SFTP mode which is secure. Then you can download logs etc.

JAIL FTP USER

If you are need a multi user FTP setup you can jail users to their home directory and deny access to the rest of the file systec. This would be seen with a web server scenario.

chroot_local_user=YES
chroot_list_enable=NO

REFERENCES

https://help.ubuntu.com/community/SSH/OpenSSH/Keys