LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-25-2024, 05:46 AM   #1
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Rep: Reputation: 54
Vsftpd: why the passive port range is not followed?


I configure vsftpd for passive mode

Code:
    listen=YES
    log_ftp_protocol=YES
    pasv_enable=YES
    pasv_address=192.168.0.2
    pasv_min_port=10090
    pasv_max_port=10100
It works but use random ports!

Look output of ss during transfer

Code:
tcp   ESTAB     0      0                            192.168.0.2:33150     192.168.0.2:21    users:(("ncftp",pid=14411,fd=4)) timer:(keepalive,119min,0) uid:1000 ino:236010 sk:400b cgroup:unreachable:1 <->    
    tcp   ESTAB     0      0                            192.168.0.2:44985     192.168.0.2:20    users:(("ncftp",pid=14411,fd=7)) timer:(keepalive,119min,0) uid:1000 ino:246607 sk:4011 cgroup:unreachable:1 <->
this is ok..without firewall, with firewall and redirect port for nat is a serious problem
Why vsftpd use random ports?

I have tried

Code:
    listen_ipv6=NO
and disable pasv_address option. But nothing

This is the complete configuration, actually

Code:
 anonymous_enable=YES
    connect_from_port_20=NO
    dirmessage_enable=YES
    ftpd_banner=Welcome
    listen=YES
    listen_ipv6=NO
    local_umask=022
    log_ftp_protocol=YES
    ls_recurse_enable=YES
    pasv_address=192.168.0.2
    pasv_enable=YES
    pasv_max_port=10100
    pasv_min_port=10090
    seccomp_sandbox=NO
    xferlog_enable=YES
    xferlog_file=/var/log/vsftpd.log
    xferlog_std_format=YES
 
Old 03-25-2024, 07:10 AM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,786

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
In your example the client (ncftp) starts an active ftp connection and it uses random high source ports to initiate the connections. The random port numbers are at the client end and 20 and 21 at the server end.

But you can always 'set passive on' at the ncftp prompt to use a passive data connection.

'pasv_enable=YES' is the default for vsftpd, and it only allows passive, it does not enforce it. The client can initiate either passive or active data connection.
 
1 members found this post helpful.
Old 03-25-2024, 07:38 AM   #3
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 408

Original Poster
Rep: Reputation: 54
Thanks, was client problem
 
  


Reply

Tags
vsftpd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VSFTPD Connection Times Out, Then Setting Passive Mode Works, Why? JockVSJock Linux - Newbie 4 11-16-2015 01:08 AM
[SOLVED] iptables port forward not working for port range mapping to anohter Port range in Linux 2.6.39 kinghong66 Linux - Networking 2 06-17-2015 07:17 PM
[SOLVED] open the port range for FTP passive transfer ccc Linux - Networking 3 10-01-2013 04:03 PM
vsftpd with port 2021 not going to passive mode jjjj12212 Linux - Software 6 02-13-2012 01:14 PM
vsftpd + passive ports range connexion problem ashokleyland Linux - Networking 1 01-03-2005 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration