Vsftpd listen yes ошибка


1

1

localadmin@it-1:~$ sudo service vsftpd status
● vsftpd.service - vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Пт 2016-09-09 10:40:30 KRAT; 4s ago
  Process: 5971 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
  Process: 5967 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
 Main PID: 5971 (code=exited, status=2)
localadmin@it-1:~$ ps -aux|grep ftp
localad+  6444  0.0  0.0  22960  1088 pts/0    S+   11:20   0:00 grep --color=auto ftp
localadmin@it-1:~$ nmap localhost 

Starting Nmap 7.01 ( https://nmap.org ) at 2016-09-09 11:20 KRAT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000099s latency).
Not shown: 996 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
25/tcp  open  smtp
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
localadmin@it-1:~$ 

Конф. файл…

localadmin@it-1:~$ cat /etc/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.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=YES
#
# Allow anonymous FTP? (Disabled by default).
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
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=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 restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
#chroot_local_user=YES
#
# 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
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# 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/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES

looking at you config I can see a few minor issues that might be causing it not to start.

First I recommend you shrink down the config file to just the variables you need like the following.

listen=YES
listen_port=21
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
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=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=YES
ssl_sslv3=YES
syslog_enable=NO
vsftpd_log_file=/var/log/vsftpd.log 

for information on what you can use go to https://security.appspot.com/vsftpd/vsftpd_conf.html

you might want to add a local_root=/folder/folder to aviod possible problems but its not required

remove

xferlog_enable=YES

some reason the default config has it on but the log location off!

its also important to note that xferlog_enabled and syslog_enable are for different logs. seen many people mix these settings and get nothing.

remove

pam_service_name=vsftpd

since you dont have guest_enable in you config file this setting does nothing. Plus other varaibles are needed for PAM to work see

How to setup virtual users for vsftpd with access to a specific sub directory?

remove

dirmessage_enable=YES

you need to provide the message_file variable for it to work

remove

listen_port=21 because 21 is the default anyway

use_localtime=YES because server time is more reliable

connect_from_port_20=YES this is not needed apart from in advanced configurations

also you might want to turn your logs

change

syslog_enable=NO

to

syslog_enable=YES

the resulting config file should be

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=YES
ssl_sslv3=YES
syslog_enable=YES
vsftpd_log_file=/var/log/vsftpd.log

If that doesn’t work remove the SSL settings and set a

Решено: vsftpd (не работает listen_ipv6=YES [РЕШЕНО])

Модератор: SLEDopit

Аватара пользователя

gluk47

Сообщения: 297
Статус: Любитель гвоздей и микроскопов
ОС: Kubuntu 17.10

Решено: vsftpd

Добрый день всем.

Как настроить vsftd на работу с ipv6? В конфиге уже всё написано.

Код:

# cd /etc/vsftpd
# grep -r listen.*= vsftpd.ipv6.conf
listen=NO
listen_ipv6=YES

# service vsftpd restart
Завершение работы vsftpd: [ ОК ]
Запускается vsftpd для vsftpd: [ ОК ]
Запускается vsftpd для vsftpd.ipv6: [ ОШИБКА ]

# vsftpd vsftpd.ipv6.conf
# echo $?
1
# ping6 ipv6.google.com -c1
PING ipv6.google.com(2a00:1450:8004::6a) 56 data bytes
64 bytes from 2a00:1450:8004::6a: icmp_seq=1 ttl=53 time=90.9 ms

[gluk47@gluk47-desktop ~]$ ензу куищще
куищще is aliased to `reboot’

Аватара пользователя

AnViar

Сообщения: 182
ОС: Linux, Solaris
Контактная информация:

Аватара пользователя

rm_

Сообщения: 3340
Статус: It’s the GNU Age
ОС: Debian
Контактная информация:

Re: Решено: vsftpd

Сообщение

rm_ » 26.05.2010 13:44

Посмотреть:

Если там 0, переключить в 1:

Попробовать перезапустить vsftpd ещё раз.

Либо оставить в 0, но тогда убрать запуск первого vsftpd, того что с vsftpd.conf-просто, в результате один процесс (тот что в логе вторым по счёту) будет слушать оба протокола (но это может не сработать, и не очень-то рекомендуется).

Аватара пользователя

gluk47

Сообщения: 297
Статус: Любитель гвоздей и микроскопов
ОС: Kubuntu 17.10

Re: Решено: vsftpd

Сообщение

gluk47 » 26.05.2010 15:21

sash-kan писал(а): ↑

26.05.2010 01:09

gluk47 писал(а): ↑

25.05.2010 21:57

[ ОШИБКА ]

логи.

Простите за глупый вопрос: где хранятся логи? :)

Код: Выделить всё

# ls /var/log/vsftp*
ls: невозможно получить доступ к /var/log/vsftp*: Нет такого файла или каталога
# service vsftpd restart
Завершение работы vsftpd:                              [   ОК  ]
Запускается vsftpd для vsftpd:                         [   ОК  ]
Запускается vsftpd для vsftpd.ipv6:                    [ ОШИБКА ]
# # ls /var/log/vsftp*
ls: невозможно получить доступ к /var/log/vsftp*: Нет такого файла или каталога

AnViar писал(а): ↑

26.05.2010 11:37

и

Всё-таки от суперпользователя)

Код: Выделить всё

$ netstat -nlp|grep ftp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
# netstat -nlp|grep ftp
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      28934/vsftpd

Как и ожидалось)

rm_ писал(а): ↑

26.05.2010 13:44

Что за магия о_О И почему smbd и sshd без этого работают?

Спасибо, теперь всё работает! :)

[gluk47@gluk47-desktop ~]$ ензу куищще
куищще is aliased to `reboot’

Аватара пользователя

SLEDopit

Модератор
Сообщения: 4814
Статус: фанат консоли (=
ОС: GNU/Debian, RHEL

Re: Решено: vsftpd

Сообщение

SLEDopit » 26.05.2010 15:52

gluk47 писал(а): ↑

26.05.2010 15:21

Простите за глупый вопрос: где хранятся логи?

Код: Выделить всё

 $ head -1 /etc/issue
Debian GNU/Linux squeeze/sid n l
 $ ls -l /var/log/vsftpd.log
-rw-r----- 1 root adm 7165 May 25 21:20 /var/log/vsftpd.log

может у вас syslog_enable включен?

Код: Выделить всё

syslog_enable
If  enabled,  then  any  log  output  which  would  have gone to
/var/log/vsftpd.log goes to the system log instead.  Logging  is
done under the FTPD facility.
Default: NO

UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. © Dennis Ritchie
The more you believe you don’t do mistakes, the more bugs are in your code.

Аватара пользователя

gluk47

Сообщения: 297
Статус: Любитель гвоздей и микроскопов
ОС: Kubuntu 17.10

Re: Решено: vsftpd

Сообщение

gluk47 » 26.05.2010 18:10

Да нет, логи туда создаются (/var/log/vsftpd.log), но там только записи о подключениях. А про ошибку там не было ни слова (и про успешный запуск демона).

[gluk47@gluk47-desktop ~]$ ензу куищще
куищще is aliased to `reboot’

Аватара пользователя

KiWi

Бывший модератор
Сообщения: 2521
Статус: статус, статус, статус
Контактная информация:

Re: Решено: vsftpd

Сообщение

KiWi » 26.05.2010 20:59

gluk47 писал(а): ↑

26.05.2010 15:21

rm_ писал(а): ↑

26.05.2010 13:44

Что за магия о_О И почему smbd и sshd без этого работают?

Спасибо, теперь всё работает! :)

Как уже выше говорили — у вас запускается ДВА vsftpd.
Один слушает ipv4, а второй — пытается слушать ipv4+ipv6.

I just installed VSFTPD on my Ubuntu system, but it doesn’t seem to work properly.

In the config file i only changed the «local_enable», «write_enable» and «listen» to YES.

When I use «netstat -tanp» or similar commands they only show me «22:sshd» but nothing on port 21.

I tried restarting VSFTPD and i tried restarting my whole VPS. Reinstalling VSFTPD didn’t help either.

The weird thing was: Before i restarted my VPS for the first time it was listening on IPv6 Port21, but now it doesn’t even listen on that anymore.

I tried everything that google told me but nothing works. It’s a fresh installation of ubuntu 16.04.4, and vsftpd is version 3.0.3

(when i try to just type «vsftpd» into my console, it tells me «500 OOPS: ruin two copies of vsftpd for IPv4 and IPv6)

TL;DR: VSFTPD not listening on Port21, any tips why?

10 More Discussions You Might Find Interesting

1. Red Hat

Snmpd service failed to start on Red Hat 6

Dear community,

I got the following error when I try to start the snmpd service:
# service snmpd start
Starting snmpd: Log say:
Could someone help please?
Thank you
Lucas

———- Post updated at 08:07 AM ———- Previous update was at 07:50 AM ———-

DAMN!!!!… (2 Replies)

Discussion started by: Lord Spectre

2. Solaris

How to check FTP service failed in between on Solaris 10?

Hi Guys,

I need to check why FTP service on Solaris 10 machine did not work in between.

What does Jun-29 means here? Does it mean that it has been RUNNING/UP since Jun 29th ?

-bash-3.2$ sudo /usr/bin/svcs |grep -i ftp
legacy_run Jun_29 lrc:/etc/rc3_d/S90proftpd
online … (3 Replies)

Discussion started by: manalisharmabe

3. Red Hat

550 Failed to change directory from FireFTP to CentOS 5.7 VSFTPD

When trying to connect from Mozilla’s FireFTP using anonymous or a FTP user on the CentOS 5.7, using VSFTPD I get the following error:

550 Failed to change directory.(View Attachment)

This is what I have in my vsftpd.conf file:

# Example config file /etc/vsftpd/vsftpd.conf # # The default… (1 Reply)

Discussion started by: jastanle84

4. Red Hat

VSFTPD Service Failed to Start

Today I have installed VSFTPD but service is failing to start.

We have been using standard FTP successful but need to introduce an FTPS option.

I have run YUM install VSFTPD and everything appeared to load ok.
(If I run rpm — qa | grep vsftpd I get vsftpd-2.0.5-16.el5_4.1 which I… (4 Replies)

Discussion started by: PaulComins

5. AIX

Q: how to start a service when system start

As topic, assume we have a service called «blahservice»

and we can start it by:

startsrc -s blahservice

what is the best practice to run such command when system start?

— directly use mkitab to add it into /etc/inittab

or

— drop startup scripts in /etc/rc.d/rcX.d

I know they… (4 Replies)

Discussion started by: acerlinux

6. SuSE

How to start Apache2 and vsftpd at boot

My apache and ftp server is working fine but when I reboot the system ftp and web server is not running automatically. Please advise on how to start apache and ftp at boot. (9 Replies)

Discussion started by: real-chess

7. Shell Programming and Scripting

Need to start a script from the point where it failed.

Hi Guys,

I have requirement where if the script fails at a particular point, then the script should run from that particular point itslf..

could anyone help me out from this..

Thanks (5 Replies)

Discussion started by: mac4rfree

8. SuSE

vsftpd won’t start on SLES 10

I recently installed SLES 10 on an x86 64bit blade server. I then installed vsftpd from the suse cds through network services; however after configuring the vsftpd.conf file, the server fails to start:

# /etc/init.d/vsftpd start
Starting vsftpd startproc: exit status of parent of… (5 Replies)

Discussion started by: dave521

9. Solaris

tmchild exec service failed erron = 2

I have a Solaris-9 box. When I log into it I get the following error message
tmchild exec service failed erron = 2 . Any ideas !!

Thanks Mike (2 Replies)

Discussion started by: mbjyork

10. UNIX for Dummies Questions & Answers

Service + vsftpd

Hello,

I have two problems:

1. The service command does not work on my system! I mean when I enter:
service … start
I get: bash: service: command not found

2. I want to launch my vsftpd server. I tried to launch it using service command and you see that it didn’t work!

Please help… (1 Reply)

Discussion started by: HSN

  • Vsc ошибка тойота кроун
  • Vsc ошибка тойота камри v40 check
  • Vsc лексус rx300 что означает ошибка
  • Vsc коды ошибок тойота
  • Vsc trac тойота рав 4 ошибка