You are not logged in.

#1 2018-02-11 13:39:25

Gunther74
Member
Registered: 2018-01-21
Posts: 31

[Solved] cant connect to vsftpd

Hello,

Im struggeling with my ftp server.
I cant connect using Filezilla.
In addition: what ftp client is installed by defoult in the terminal? I need a manual of that, i dont know howto use it and man ftp isnt telling me much.

My server is running vsftpd wich listens on port 10021
I try to connect true my lan using Filezilla
The certificate is ok becouse Filezilla asks if i want to accept it.

Filezilla gives this errors:
Fout:    GnuTLS-fout -15: Er werd een onverwacht TLS-pakket ontvangen.
Fout:    Kan niet verbinden met server

Im tailing /var/log/vsftpd.log wich shows this:

Sun Feb 11 14:20:17 2018 [pid 2] CONNECT: Client "192.168.0.213"
Sun Feb 11 14:20:25 2018 [pid 1] [gunther] OK LOGIN: Client "192.168.0.213"
Sun Feb 11 14:20:31 2018 [pid 2] CONNECT: Client "192.168.0.213"
Sun Feb 11 14:20:31 2018 [pid 1] [gunther] OK LOGIN: Client "192.168.0.213"

This log looks like theres nothing wrong.

This is my /etc/hosts.allow file:

# Allow all connections
vsftpd: ALL
# IP adress range
vsftpd: 10.0.0.0/255.255.255.0

I have this in my nftables

table inet filter {
	chain input {
		type filter hook input priority 0; policy drop;
		ct state established,related accept
		iif "lo" accept
		ct state invalid drop
		icmp type echo-request ct state new accept
		ip protocol udp ct state new jump UDP
		tcp flags & (fin | syn | rst | ack) == syn ct state new jump TCP
		ip protocol udp reject
		ip protocol tcp reject with tcp reset
		meta nfproto ipv4 counter packets 0 bytes 0 reject with icmp type prot-unreachable
	}

	chain forward {
		type filter hook forward priority 0; policy drop;
	}

	chain output {
		type filter hook output priority 0; policy accept;
	}

	chain TCP {
		tcp dport ssh accept
		tcp dport amanda accept
		tcp dport 10443 accept
		tcp dport 10022 accept
		tcp dport 10021 accept
	}

	chain UDP {
	}
}

My /etc/vsftpd.conf looks like this:

# 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.
#
listen_port=10021

pasv_min_port=5000
pasv_max_port=5003
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
#anonymous_enable=YES
#
# 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=ftpsecure
#
# 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 blah FTP service.
#
# 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().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# 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
#
# 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

ssl_enable=YES

#choose what you like, if you accept anonymous connections, you may want to enable this
# allow_anon_ssl=NO

#by default all non anonymous logins and forced to use SSL to send and receive password and dat$
force_local_logins_ssl=YES
force_local_data_ssl=YES

#you should at least enable TLS v1 if you enable SSL
ssl_tlsv1=YES
#these options will permit or prevent SSL v2 and v3 protocol connections. TLS v1 connections ar$
ssl_sslv2=NO
ssl_sslv3=YES

#give the correct path to your .pem file
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
#the .pem file also contains the private key
rsa_private_key_file=/etc/ssl/certs/vsftpd.pem

I hope i supplyed enough info, else feel free to ask.
Thanks Gunther

Last edited by Gunther74 (2018-02-12 17:40:22)

Offline

#2 2018-02-11 13:45:25

Gunther74
Member
Registered: 2018-01-21
Posts: 31

Re: [Solved] cant connect to vsftpd

When i change Filezilla to sftp filezilla tells me this:

Status:	Verbinden met 192.168.0.100:10021...
Antwoord:	fzSftp started, protocol_version=8
Opdracht:	open "gunther@192.168.0.100" 10021
Fout:	Verbinding verlopen na 20 seconden inactiviteit
Fout:	Kan niet verbinden met server

my log says:

Sun Feb 11 14:42:02 2018 [pid 2] CONNECT: Client "192.168.0.213"
Sun Feb 11 14:42:28 2018 [pid 2] CONNECT: Client "192.168.0.213"

Offline

#3 2018-02-12 17:04:51

Gunther74
Member
Registered: 2018-01-21
Posts: 31

Re: [Solved] cant connect to vsftpd

I have flushed my ruleset,
Regenerated the key and certificate.
Checked theire location in the conf file.
I can ping the host.

Nothing works.
Anyone got a idea?

Offline

#4 2018-02-12 17:19:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] cant connect to vsftpd

No ftp client is installed by default. lftp is a decent command line tool.

Paste errors in English: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2018-02-12 17:20:15

Gunther74
Member
Registered: 2018-01-21
Posts: 31

Re: [Solved] cant connect to vsftpd

Im a bit closer thanks to the Wiki

Wiki wrote:

FileZilla Client: GnuTLS error -8 -15 -110 when connecting via SSL

vsftpd tries to display plain-text error messages in the SSL session. In order to debug this, temporarily disable encryption and you will see the correct error message.[1] [2]

This made the error visible, chroot list missing.
I disabled the chroot list as this is a private server.

Now the server goes in to pavive mode and fails there.
I will need to add the ports of the pasive in my nftables list.

I will post a update later.

Offline

#6 2018-02-12 17:35:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,722

Re: [Solved] cant connect to vsftpd

I am not sure exactly what you are trying to do, but rather than try to help with vsftp, might I suggest a tangential solution?  Why not use sftp?  It is supported by Filezilla, and depends only upon openssh; and is enabled already if you have an ssh server enabled.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2018-02-12 17:38:38

Gunther74
Member
Registered: 2018-01-21
Posts: 31

Re: [Solved] cant connect to vsftpd

There we go,

Ports added in the firewall, enabled SSL again, all works now.

@Jasonwryan : I did not install a ftp client (unless it came with a group) i can type ftp in my prompt, im just not sure how to use it.

Offline

#8 2018-02-12 17:42:35

Gunther74
Member
Registered: 2018-01-21
Posts: 31

Re: [Solved] cant connect to vsftpd

ewaller wrote:

I am not sure exactly what you are trying to do, but rather than try to help with vsftp, might I suggest a tangential solution?  Why not use sftp?  It is supported by Filezilla, and depends only upon openssh; and is enabled already if you have an ssh server enabled.

I didnt know there was ftp among openssl.
When i searched the wiki 1 of the 1st hits i came across was vsftpd wich i used before on a ubuntu server distro.

So i guess openssl is where the ftp command comes from.

Offline

#9 2018-02-12 18:00:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] cant connect to vsftpd

Gunther74 wrote:

So i guess openssl is where the ftp command comes from.

No need to guess:

┌─[Centurion ~]
└─╼ pacman -Qo /usr/bin/ftp
/usr/bin/ftp is owned by inetutils 1.9.4-5

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB