Просмотр исходного кода

added workaround for passive mode under NATed network

Serghey Rodin 13 лет назад
Родитель
Сommit
cc1f6fbf63
2 измененных файлов с 8 добавлено и 0 удалено
  1. 3 0
      install/0.9.7/rhel/vsftpd.conf
  2. 5 0
      install/vst-install.sh

+ 3 - 0
install/0.9.7/rhel/vsftpd.conf

@@ -13,3 +13,6 @@ pam_service_name=vsftpd
 userlist_enable=YES
 userlist_enable=YES
 tcp_wrappers=YES
 tcp_wrappers=YES
 force_dot_files=YES
 force_dot_files=YES
+pasv_enable=YES
+pasv_max_port=12100
+pasv_min_port=12000

+ 5 - 0
install/vst-install.sh

@@ -575,6 +575,11 @@ wget vestacp.com/notify/?$REPO -O /dev/null
 
 
 # Get server ip
 # Get server ip
 vst_ip=$(wget vestacp.com/what-is-my-ip/ -O - 2>/dev/null)
 vst_ip=$(wget vestacp.com/what-is-my-ip/ -O - 2>/dev/null)
+if [ ! -z "$vst_ip" ] && [ "$vst_ip" != "$main_ip" ]; then
+    # Assign passive ip address
+    echo "pasv_address=54.246.111.50" >> /etc/vsftpd/vsftpd.conf
+fi
+
 if [ -z "$vst_ip" ]; then
 if [ -z "$vst_ip" ]; then
     vst_ip=$main_ip
     vst_ip=$main_ip
 fi
 fi