I can't get through to the vsftpd server remotely, nothing goes in the log
file. I think it is pf that is the problem...

My pf.conf...
#       $OpenBSD: pf.conf,v 1.50 2011/04/28 00:19:42 mikeb Exp $
#
# See pf.conf(5) for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.

#interfaces
int_if="fxp0"

#hosts
murphy="10.0.0.2"
fekete="10.0.0.3"

#host port forwarding
murphy_ports = "{ 8333 }"
fekete_ports = "{ 17001, 39191, 5938 }"

#other
tcp_services="{ 22, 21 }"
icmp_types="echoreq"

set skip on lo

# filter rules and anchor for ftp-proxy(8)
anchor "ftp-proxy/*"
pass in quick inet proto tcp to port ftp divert-to 127.0.0.1 port 8021

#nat rule for all interfaces
match out on egress inet from !(egress:network) to any nat-to (egress:0)

pass            # to establish keep-state

#block in quick from urpf-failed to any # use with care

# By default, do not permit remote connections to X11
block in on ! lo0 proto tcp to port 6000:6010

block in log
pass out quick

antispoof quick for { lo $int_if }

pass in on egress inet proto tcp from any to (egress) \
        port $tcp_services

#FTP
pass in on egress inet proto tcp from any to (egress) \
        port > 49151

#nat port redirects
pass in on egress inet proto tcp to (egress) port $murphy_ports rdr-to
$murphy
pass in on egress inet proto tcp to (egress) port $fekete_ports rdr-to
$fekete

pass in inet proto icmp all icmp-type $icmp_types

pass in on $int_if

My vsftpd.conf...
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# SSL
#ssl_enable=YES
#
# TCP Wrappers
#tcp_wrappers=YES
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this
out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
#write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you
will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=_vsftpd
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do
ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to Kintaro's home. Where the downstream is small but
the system enourmous.
#
# You may specify a file of disallowed anonymous e-mail addresses.
Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/ftpchroot
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror"
assume
# the presence of the "-R" option, so there is a strong case for enabling
it.
#ls_recurse_enable=YES
#
#
# If enabled, vsftpd will load a list of usernames from the filename
# given by userlist_file. If a user tries to log in using a name in this
# file, they will be denied before they are asked for a password.
# This may be useful in preventing clear text passwords being transmitted.
userlist_enable=YES
#
# This option is the name of the file loaded when the userlist_enable
# option is active.
userlist_file=/etc/ftpusers
#
# This option should be the name of a directory which is empty. Also,
# the directory should not be writable by the ftp user. This directory
# is used as a secure chroot() jail at times vsftpd does not require
# filesystem access.
secure_chroot_dir=/var/vsftpd
#
# The minimum port to allocate for PASV style data connections.
# Can be used to specify a narrow port range to assist firewalling.
pasv_min_port=49152
#
# The maximum port to allocate for PASV style data connections.
# Can be used to specify a narrow port range to assist firewalling.
pasv_max_port=65535
#
# By default, numeric IDs are shown in the user and group fields of
# directory listings. You can get textual names by enabling this parameter.
# It is off by default for performance reasons.
text_userdb_names=YES
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and
IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
background=YES
log_ftp_protocol=YES
xferlog_enable=YES
pasv_enable=YES
pasv_min_port=49151
pasv_max_port=65535




On Tue, Apr 2, 2013 at 4:53 PM, John Tate <j...@johntate.org> wrote:

> Nevermind, found it.
>
>
> On Tue, Apr 2, 2013 at 4:45 PM, John Tate <j...@johntate.org> wrote:
>
>> Where do I set ports in vsftpd.conf for incoming data, I've just looked
>> around that link you provided and I can't find the option.
>>
>> I can't get through to vsftpd or pure_ftpd, probably because I didn't
>> have incoming data ports open. I can get through on localhost and my local
>> network so I assume it's pf.
>>
>> pass in on egress inet proto tcp from any to (egress) \
>>         port > 49151
>>
>> I've added that line but where do I set the ports on vsftpd?
>>
>>
>>
>> On Tue, Apr 2, 2013 at 4:30 PM, Richard Toohey <
>> richardtoo...@paradise.net.nz> wrote:
>>
>>> On 04/02/13 18:13, John Tate wrote:
>>>
>>>> I can't find that config option.
>>>>
>>> I think Stuart is talking about the background option from here:
>>>
>>> https://security.appspot.com/**vsftpd/vsftpd_conf.html<https://security.appspot.com/vsftpd/vsftpd_conf.html>
>>>
>>> Also look at listen, etc.
>>>
>>> For logging - log_ftp_protocol & syslog_enable & xferlog_enable &
>>> vsftpd_log_file & xferlog_file options.
>>>
>>>
>>>>
>>>> On Tue, Apr 2, 2013 at 9:52 AM, Stuart Henderson <s...@spacehopper.org
>>>> >wrote:
>>>>
>>>>  On 2013-04-01, John Tate <j...@johntate.org> wrote:
>>>>>
>>>>>> I've not used it in a while and I can't get it to run. I can't find
>>>>>> any
>>>>>> logging options or anything.
>>>>>>
>>>>>> # vsftpd
>>>>>>
>>>>>> ...
>>>>>> (It just sits there doing nothing)
>>>>>>
>>>>>> How do I get it to work?
>>>>>>
>>>>>> I'm using the default config with only my own banner.
>>>>>>
>>>>>>  It is waiting for a connection (there is a config option to run
>>>>> it in the background).
>>>>>
>>>>> We should probably add an rc.d script to the port to make it easier.
>>>>>
>>>>
>>>
>>
>>
>> --
>> www.johntate.org
>>
>
>
>
> --
> www.johntate.org
>



-- 
www.johntate.org

Reply via email to