Condividi tramite


How to use Azure Linux VM as an FTP server

The following resources are used for setting up Azure Linux VM for FTP server.
- Linux OS : ubuntu
- vsftpd

1. Create a Linux VM with Ubuntu : th-ubuntu.cloudapp.net

2. Setup end point : port 60001, 60002 are added in the example

3. Install vsftpd
sudo apt-get install vsftpd

4. Configure /etc/vsftpd.conf : an example attached
listen=YES
#anonymous_enable=YES
local_enable=YES
write_enable=YES
ls_recurse_enable=NO
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
xferlog_std_format=NO
log_ftp_protocol=YES
connect_from_port_20=YES
chown_uploads=NO
xferlog_file=/var/log/vsftpd.log
ascii_upload_enable=NO
ascii_download_enable=NO
ftpd_banner=Welcome to Taehee's FTP service.
local_root=/home/ftp
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
pasv_enable=YES
pasv_min_port=60001
pasv_max_port=60002
port_enable=YES
pasv_addr_resolve=NO
file_open_mode=0666
local_umask=0022

5. Restart vsftpd,
root@th-ubuntu:~# service vsftpd restart

6. Create a user, “ftpuser” in this example

7. Change directory ownership
 root@th-ubuntu:~# chown ftpuser:ftpuser /home/ftp

8. Test from winscp, click "Advanced and set Directories with /home/ftp".