Меню

Vsftpd listen yes ошибка

Решено: 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.

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

I have Rapsberry Pi B+ with Arch Linux installation. uname reports version:

[computer@computer001 ~]$ uname -a
Linux computer001 3.18.3-3-ARCH #1 PREEMPT Mon Jan 26 20:10:28 MST 2015 armv6l GNU/Linux

I’ve installed ftp server via pacman -S vsftpd and installation has passed without any errors. Then I tried to configure it, which resulted in following vsftpd.conf:

anonymous_enable=NO
local_enable=YES
write_enable=YES
#local_umask=022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=computer
#xferlog_file=/var/log/vsftpd.log
#xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
#ascii_download_enable=YES
ftpd_banner=Welcome to personal ftp service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
#chroot_local_user=YES
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
ls_recurse_enable=YES
listen=YES
#listen_ipv6=YES

Now, when I try to restart vsftpd, I get:

[computer@computer001 etc]$ sudo systemctl restart vsftpd.service && systemctl status -l vsftpd.service
* vsftpd.service - vsftpd daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 1970-01-01 06:32:24 UTC; 112ms ago
  Process: 350 ExecStart=/usr/bin/vsftpd (code=exited, status=2)
 Main PID: 350 (code=exited, status=2)

Here is also output of sudo journalctl | grep -i vsftp:

Jan 01 06:32:24 computer001001 sudo[347]: computer001 : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/usr/bin/systemctl restart vsftpd.service
Jan 01 06:32:24 computer001001 systemd[1]: Starting vsftpd daemon...
Jan 01 06:32:24 computer001001 systemd[1]: Started vsftpd daemon.
Jan 01 06:32:24 computer001001 systemd[1]: vsftpd.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 01 06:32:24 computer001001 systemd[1]: Unit vsftpd.service entered failed state.
Jan 01 06:32:24 computer001001 systemd[1]: vsftpd.service failed.

Here is unit script /usr/lib/systemd/system/vsftpd.service:

[Unit]
Description=vsftpd daemon
After=network.target

[Service]
ExecStart=/usr/bin/vsftpd
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=multi-user.target

If I run sudo /usr/bin/vsftpd, I get following error:

500 OOPS: config file not owned by correct user, or not a file

I have corrected file permissions for /etc/vsftpd.conf via sudo chown root:root /etc/vsftpd.conf and now manually server gets started.
I am also aware date/time is not correct, I haven’t setup it yet.What am I missing?

  • Печать

Страницы: [1] 2  Все   Вниз

Тема: настройка vsftpd  (Прочитано 3733 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
perlito

Добрый день никак не могу настроить ftp. использую vsftpd однако никак не конектится к нему даже под рутом, в логах пишет ошибка авторизации.

файл настроек вот

listen=YES #запускается без использования xinetd.

anonymous_enable=YES #разрешаем вход анонимусам.
local_enable=YES #разрешаем вход локальным пользователям.
write_enable=YES #разрешаем выполнение команд STOR, DELE, RNFR, RNTO, MKD, RMD, APPE and SITE.
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES #даем анонимусам право записи и т.п.
dirmessage_enable=YES #показывать сообщение при первом входе в каталог.
connect_from_port_20=YES
chown_uploads=YES #изменять владельца загуржаемых файлов
chown_username=ftpserg #собственно указывается новый владелец
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=120
nopriv_user=nobody
ascii_upload_enable=NO
ascii_download_enable=NO
ftpd_banner=Welcome to CrazyNetwork FTP server.
convert_charset_enable=YES #включаем перекодировку
local_charset=UTF8 #локаль сервера
remote_charset=WIN1251 #локаль клиента
user_config_dir=/etc/vsftpd/vusers #указываем директорию с конфигурациями наших пользователей
chroot_local_user=YES #чрутим локальных пользователей в их домашний каталог
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
userlist_file=/etc/vsftpd/user_list #список пользователей которым позволено подключаться к серверу
userlist_enable=YES # сами
userlist_deny=NO    # правила

а в chroot_list прописал только root и все

может кто нибудь знает?

Спасибо

perlito.ru -> о perl на русском


Оффлайн
djrust

может все таки логи покажите?


Оффлайн
perlito

Вот и логи

Tue Aug  7 10:49:13 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:49:45 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 10:49:46 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:59:27 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:59:30 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 10:59:31 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:12:18 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:12:20 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:12:21 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:01 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:03 2012 [pid 1] [perlito] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:16:05 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:14 2012 [pid 1] [perlito] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:16:15 2012 [pid 2] CONNECT: Client «141.136.65.223»

perlito.ru -> о perl на русском


Оффлайн
X.3.

ЕМНИП под root нельзя залогиниться. Создайте отельного пользователя.


Оффлайн
perlito

Спасибо, а как?
Создавая комадой adduser и добавляя в список /etc/vsftpd/user_list не получается

« Последнее редактирование: 08 Августа 2012, 09:41:21 от tiko.svyazist »

perlito.ru -> о perl на русском


Оффлайн
victor00000

tiko.svyazist,

sudo mkdir /mo
echo "HELLO" | sudo tee /mo/hello.txt
sudo useradd mo -d /mo
sudo chown mo:mo -R /mo
sudo passwd mo
и клиент фтп логин мо и пароль.


Оффлайн
perlito

Создал как вы сказали, тоже не помогло, и в список занес, тоже не помогло

perlito.ru -> о perl на русском


Оффлайн
victor00000


Оффлайн
perlito

Tue Aug  7 10:49:13 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:49:45 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 10:49:46 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:59:27 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 10:59:30 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 10:59:31 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:12:18 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:12:20 2012 [pid 1] [root] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:12:21 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:01 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:03 2012 [pid 1] [perlito] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:16:05 2012 [pid 2] CONNECT: Client «141.136.65.223»
Tue Aug  7 11:16:14 2012 [pid 1] [perlito] FAIL LOGIN: Client «141.136.65.223»
Tue Aug  7 11:16:15 2012 [pid 2] CONNECT: Client «141.136.65.223»

Нового ничего в логах не пишет если по новому пользователю зайти.
А в Krusader(ftp клиенте) выдает ошибку tymed out trying to connect to remote host

« Последнее редактирование: 08 Августа 2012, 10:08:47 от tiko.svyazist »

perlito.ru -> о perl на русском


Оффлайн
victor00000

у тебя vsftpd conf непонял, лучше поумолчания.


Оффлайн
X.3.

а если указать pam сервис?
pam_service_name=passwd


Оффлайн
perlito

perlito.ru -> о perl на русском


Оффлайн
victor00000

так

sudo useradd mo -d /mo -s /usr/bin/passwdесли не работает, нужно gedit /etc/shells добавить строк /usr/bin/passwd


Оффлайн
pavelb73

Здравствуйте!
Хочу чтобы vsftpd работал только в активном режиме… Пока не получается. Браузер выкидывает ошибку 550 Permission denied.
Однако через ftp-клиент (Cyberduck) захожу на ftp сервер. Но попытка скачать файл пресекается с этой же ошибкой.
Если разрешить пасивный режим, т.е. pasv_enable=YES, то все работает. Подскажите, пожалуйста, где ошибка?

Настройки vsftpd.conf такие:

listen=YES
#listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=0022
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
#connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
#xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
#ascii_download_enable=YES
ftpd_banner=Welcome to our FTP service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
chroot_local_user=YES
#chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
ls_recurse_enable=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd.virtual
#rsa_cert_file=/etc/ssl/private/vsftpd.pem
#
user_sub_token=$USER
local_root=/srv/ftp-users/$USER
guest_enable=YES
guest_username=ftp
user_config_dir=/etc/vsftpd/users/
virtual_use_local_privs=NO
chmod_enable=YES
chown_uploads=YES
chown_username=ftp
anon_umask=0022
file_open_mode=0777
hide_ids=YES
#log_ftp_protocol=YES
userlist_enable=YES
userlist_file=/etc/ftpusers
Type  :quit<Enter>  to exit Vim


Оффлайн
AnrDaemon

Браузеры обычно в принципе не работают в активном режиме.

Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.

Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…


  • Печать

Страницы: [1] 2  Все   Вверх

The problem is that the vsftpd service fails to start after transferring a working configuration from another server.

Of vsftpd‘s configuration files, only these were modified:

  • /etc/vsftpd.chroot_list to add local user names.
  • /etc/vsftpd/vsftpd.conf

The configuration is as follows and (*) indicates changes or additions to the distribution defaults:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Hello.
listen=YES (*)
listen_ipv6=NO (*)
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
dual_log_enable=YES
use_localtime=YES (*)
rsa_cert_file=/path/to/vsftpd.crt (*)
rsa_private_key_file=/path/to/vsftpd.key (*)
ssl_enable=YES (*)
allow_anon_ssl=NO (*)
force_local_data_ssl=NO (*)
force_local_logins_ssl=NO (*)
ssl_tlsv1=YES (*)
ssl_sslv2=NO (*)
ssl_sslv3=NO (*)
require_ssl_reuse=NO (*)
ssl_ciphers=HIGH (*)
ssl_tlsv1_1=YES (*)
ssl_tlsv1_2=YES (*)
allow_writeable_chroot=YES (*)

It is emphasized that the configuration was ported from a working vsftpd instance. The working vsftpd-2.2.2-24.el6.x86_64 instance was on RHEL 6 (CentOS 6) and the new vsftpd-3.0.2-22.el7.x86_64 instance is on RHEL 7 (CentOS 7). In fact, a very similar configuration trivially started on another server.

VSFTP Fails to start CentOS 7 is unhelpful. It is NOT required that listen_ipv6=YES is set as it is only required that one of either listen_ipv6 or listen is set YES and that the other is set NO.
Also, while allow_writeable_chroot=YES was not present on the original working configuration, it is NOT required to simply start vsftpd (though it is essential to resolve a different issue related to migrating the configuration from RHEL 6 to RHEL 7).

$ sudo systemctl status vsftpd
* vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled;
     vendor preset: disabled)
   Active: inactive (dead)
$ sudo systemctl enable vsftpd
 Created symlink from /etc/systemd/system/multi-user.target.wants/
   vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
$ sudo systemctl start vsftpd
 Job for vsftpd.service failed because the control process exited with
   error code. See "systemctl status vsftpd.service" and "journalctl -xe"
     for details.
$ sudo systemctl -l status vsftpd
 * vsftpd.service - Vsftpd ftp daemon
    Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled;
      vendor preset: disabled)
    Active: failed (Result: exit-code) since Tue 2018-07-31 22:07:56 CDT;
      6min ago
   Process: 10131 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
     (code=exited, status=2)

 Jul 31 22:07:56 host.example.com systemd[1]: Starting Vsftpd ftp daemon...
 Jul 31 22:07:56 host.domain.tld systemd[1]: vsftpd.service: control process exited, code=exited status=2
 Jul 31 22:07:56 host.domain.tld systemd[1]: Failed to start Vsftpd ftp daemon.
 Jul 31 22:07:56 host.domain.tld systemd[1]: Unit vsftpd.service entered failed state.
 Jul 31 22:07:56 host.domain.tld systemd[1]: vsftpd.service failed.

 $ sudo journalct -xe

 Jul 31 22:23:33 host.domain.tld sudo[11537]: user : TTY=pts/0 ; PWD=/etc/vsftpd ; USER=root ; COMMAND=/bin/systemctl start vsftpd
 Jul 31 22:23:33 host.domain.tld polkitd[697]: Registered Authentication Agent for unix-process:11538:187361910 (system bus name :1.13901 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, loc
 Jul 31 22:23:33 host.domain.tld systemd[1]: Starting Vsftpd ftp daemon...
 -- Subject: Unit vsftpd.service has begun start-up
 -- Defined-By: systemd
 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 --
 -- Unit vsftpd.service has begun starting up.
 Jul 31 22:23:33 host.domain.tld systemd[1]: vsftpd.service: control process exited, code=exited status=2
 Jul 31 22:23:33 host.domain.tld systemd[1]: Failed to start Vsftpd ftp daemon.
 -- Subject: Unit vsftpd.service has failed
 -- Defined-By: systemd
 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 --
 -- Unit vsftpd.service has failed.
 --
 -- The result is failed.
 Jul 31 22:23:33 host.domain.tld systemd[1]: Unit vsftpd.service entered failed state.
 Jul 31 22:23:33 host.domain.tld systemd[1]: vsftpd.service failed.

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Official Flavours Support
  • Installation & Upgrades
  • [SOLVED] vsftpd error in configuration

  1. vsftpd error in configuration

    Hello. I’ve just installed vsftpd in 10.04LTS.

    My goal is to have virtual users that can upload files but not downaload. For this I’ve read the config, followed some tutorials and examples but I keep gettin: 553 Could not create file.

    I can successfully login with «adoora» user but I can’t put or send files.

    My /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
    listen_port=21
    #
    # Run standalone with IPv6?
    # Like the listen parameter, except vsftpd will listen on an IPv6 socket
    # instead of an IPv4 one. This parameter and the listen parameter are mutually
    # exclusive.
    #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=www-data
    #
    # 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
    #
    # 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().
    #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
    #
    # Debian customization
    #
    # Some of vsftpd’s settings don’t fit the Debian filesystem layout by
    # default. These settings are more Debian-friendly.
    #
    # 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=ftp
    #
    # This option specifies the location of the RSA certificate to use for SSL
    # encrypted connections.
    rsa_cert_file=/etc/ssl/private/vsftpd.pem
    #
    # 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=ftp

    download_enable=NO
    pasv_min_port=3000
    pasv_max_port=3050

    #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

    hide_ids=YES

    # Enable (only) guests.
    guest_enable=YES
    # This is not needed, it’s the default. Just here for clarity.
    guest_username=ftp
    # Where the guests (virtual) usernames are set.
    user_config_dir=/etc/vsftpd/vusers

    My /etc/vsftpd/vusers/adoora

    write_enable=YES
    anon_mkdir_write_enable=YES
    anon_other_write_enable=YES
    anon_upload_enable=YES
    local_root=/srv/ftp
    chroot_local_user=YES
    dirlist_enable=YES
    download_enable=YES
    guest_username=ftp

    root@adoora:/var/www/adoora/ftp# ls -al /srv/ftp
    total 8
    drwxr-xr-x 2 ftp ftp 4096 2012-02-14 15:13 .
    drwxr-xr-x 3 root root 4096 2012-02-14 15:13 ..

    Another error I have is that I can’t set it to work with /etc/init.d.

    If I put `listen=YES` I can `sudo vsftpd` but if I execute it with init.d I get:

    rasca@adoora:~$ sudo /etc/init.d/vsftpd start
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service vsftpd start

    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the start(8) utility, e.g. start vsftpd

    And if I change listen=NO I can’t start it in standalone mode and for the init.d way same message and no vsftpd.

    Can anyone please help me? Thanks!!!
    Iv�n


  2. Re: vsftpd error in configuration

    I managed to upload files but I still cannot start it via service or /etc/init.d

    I get:

    $ sudo /etc/init.d/vsftpd start
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service vsftpd start

    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the start(8) utility, e.g. start vsftpd
    vsftpd stop/pre-start, process 3665

    $ start vsftpd
    start: Rejected send message, 1 matched rules; type=»method_call», sender=»:1.5″ (uid=1001 pid=3765 comm=»start) interface=»com.ubuntu.Upstart0_6.Job» member=»Start» error name=»(unset)» requested_reply=0 destination=»com.ubuntu.Upstart» (uid=0 pid=1 comm=»/sbin/init))


  3. [SOLVED] Re: vsftpd error in configuration

    Okey solved it. That error was just that I wasn’t root and it didn’t run because I was running it with listen=NO because /etc/init.d/vsftpd start told me I needed to put listen=NO.

    When I changed this to listen=YES and did the service vsftpd start instead of /etc/init.d/vsftpd it started working.


Bookmarks

Bookmarks


Posting Permissions

View previous topic :: View next topic  
Author Message
salmonix
Guru
Guru

Joined: 16 Jul 2006
Posts: 410

PostPosted: Thu Feb 25, 2010 5:26 pm    Post subject: [SOLVED] vsftpd: couldnot bind listening IPv4 socket Reply with quote

Hi there,

trying to start vsftpd 2.1.0, I receive the error:

Quote:
500 OOPS: could not bind listening IPv4 socket


Quote:
grep -v ^# vsftpd.conf

listen=YES

local_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

ftpd_banner=Welcome to FACE-R service

chroot_local_user=YES

chroot_list_enable=YES

I do not use xinetd.

USE flags: pam ssl tcpd — and without tcpd

I have also tried #listen=YES

No firewall.

No idea.
_________________
Quis custodiet ipsos, custodes?

Last edited by salmonix on Sun Feb 28, 2010 5:54 pm; edited 1 time in total

Back to top

View user's profile Send private message

cach0rr0
Bodhisattva
Bodhisattva

Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Feb 26, 2010 1:06 am    Post subject: Re: vsftpd: couldnot bind listening IPv4 socket Reply with quote

hrmm…try this

Code:

listen=YES

anonymous_enable=NO

local_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

xferlog_file=/var/log/vsftpd.log

idle_session_timeout=600

data_connection_timeout=120

ftpd_banner=Welcome to FACE-R service

chroot_local_user=YES

ls_recurse_enable=NO

local_umask=022

My use are pam ssl tcpd -caps -selinux -xinetd

Other thing to check

Code:

netstat -anp |grep :21

Make sure nothing else is listening.
_________________
Lost configuring your system?

dump lspci -n here | see Pappy’s guide | Link Stash

Back to top

View user's profile Send private message

salmonix
Guru
Guru

Joined: 16 Jul 2006
Posts: 410

PostPosted: Fri Feb 26, 2010 7:51 am    Post subject: Reply with quote

Ridiculous…

Quote:
500 OOPS: bad bool value in config file for: listen

What is good bool value, then?

Otherwise nope, p 21 is free. (Actually no other service is up, except the basic system services.)
_________________
Quis custodiet ipsos, custodes?

Back to top

View user's profile Send private message

cach0rr0
Bodhisattva
Bodhisattva

Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Feb 26, 2010 9:49 am    Post subject: Reply with quote

what the hell?

I mean, i dont normally have my FTP server started unless i need to put something up for someone, but I just tested to make sure:

Code:

gentoob0x ~ # /etc/init.d/vsftpd start

 * Starting vsftpd …                                                                                                                                                                    [ ok ]

gentoob0x ~ # netstat -anp |grep :21

tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN     32442/vsftpd

My entire config is as such (i have it chowned to apache because at one point I had users uploading everything to web-accessible directories)

Code:

listen=YES

anonymous_enable=NO

local_enable=YES

write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

# Make sure PORT transfer connections originate from port 20 (ftp-data).

chroot_local_user=YES

connect_from_port_20=YES

xferlog_file=/var/log/vsftpd.log

idle_session_timeout=600

data_connection_timeout=120

ftpd_banner= Generic FTP Daemon Ready

ls_recurse_enable=NO

chown_uploads=YES

chown_username=apache

local_umask=022

I would of course comment out chown_username should you choose to use my file verbatim.

The only thing I can gather, maybe it can’t create the pid file, or write to the log? (regarding the first error)

Could always strace it I suppose. Just an

Code:
strace /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

and see if it bombs out. If that runs successfully with your config file (the original one of course), you should see something like this as the last lines:

Code:

bind(3, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr(«0.0.0.0»)}, 16) = 0

listen(3, 32)                           = 0

accept(3,

and it will sit like that until it gets a connection. If so, leaning towards a permissions issue. If not, looking at a configuration issue.

Either way, strace should show something useful

My other thought would be for hardened-sources, if maybe you had any of the uid/gid socket protections turned on. If not hardened-sources, that of course does not apply to you.
_________________
Lost configuring your system?

dump lspci -n here | see Pappy’s guide | Link Stash

Back to top

View user's profile Send private message

salmonix
Guru
Guru

Joined: 16 Jul 2006
Posts: 410

PostPosted: Sun Feb 28, 2010 5:54 pm    Post subject: Reply with quote

Solved. Unfortunately I do not know how — I am working under stress now and the solution got deleted from my memory giving place other things — if it was there ever.

Thanx for your concern.
_________________
Quis custodiet ipsos, custodes?
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Vsc ошибка тойота камри v40 check
  • Vsc лексус rx300 что означает ошибка