Azure VM FTP Server Error: 550 Create directory operation failed

613 views Asked by At

I am trying to set home directory for FTP Server created on Azure VM (Linux) and I tried many ways taking help of google, but it throws error saying

  1. If I add $USER in local_root while modifying /etc/vsftpd.conf file

ftp> mkdir blob 550 Create directory operation failed.

  1. If I dont use $USER

500 OOPS: cannot change directory:/home/ftp

  1. I have set below configuration in /etc/vsftpd.conf file
    listen=NO
    
    listen_ipv6=YES
    
    anonymous_enable=NO
    
    local_enable=YES
    
    write_enable=YES
    
    anon_upload_enable=YES
    
    anon_mkdir_write_enable=YES
    
    dirmessage_enable=YES
    
    use_localtime=YES
    
    xferlog_enable=YES
    
    connect_from_port_20=YES
    
    chroot_local_user=YES
    
    user_sub_token=$USER
    
    local_root=/home/$USER/ftp
    
    allow_writeable_chroot=YES
    
    pasv_enable=YES
    
    pasv_min_port=10000
    
    pasv_max_port=10010
    
    chroot_list_file=/etc/vsftpd.chroot_list
    
    secure_chroot_dir=/var/run/vsftpd/empty
    
    pam_service_name=vsftpd
    
    rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    
    rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    
    ssl_enable=NO

Kindly help in fixing this issue while setting home directory for FTP Server (Azure VM).

1

There are 1 answers

0
Mayank Mani Pandey On

I got my answer. We have two ways to short out this issue.

  1. ftpClient.DataConnectionType = FtpDataConnectionType.AutoActive; Though this works out well, but this is not recommended.
  2. ftpClient.DataConnectionType = FtpDataConnectionType.AutoPassive; This is recommended in case of Azure VM. And to work it out, we need to enable pasv_enable=true in AZURE VM through cmd and also have to enable port range in Azure VM through Portal.

pasv_enable=Yes <br>
pasv_max_port=10010<br>
pasv_min_port=10000

Here is what I found as an explanation on Microsoft link-

A multiregion deployment can use an active-active or active-passive configuration. An active-active configuration distributes requests across multiple active regions. An active-passive configuration keeps warm instances in the secondary region, but doesn't send traffic there unless the primary region fails. For more explanation please refer the link Azure VM Active Passive

as it makes azure configuration mode which results all the traffic in open mode

Please suggest better approach if any.