0
2
Fedora 16, system-config-firewall отключен, SELinux тоже(в /etc/selinux/config прописано SELINUX=disabled и $ /usr/sbin/getenforce выдает Disabled).
Под анонимным пользователем заходит нормально, а под локальными пользователями — «ошибка регистрации пользователя».
Локального пользователя, под которым я хочу зайти, нет в ftpusers и user_list.
Fedora 13 и 15 нормально работают с этим конфигом, а Fedora 16 — нет.
Конфиг:
ftpusers
# Users that are not allowed to login via ftp
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
vsftpd.conf
# Example config file /etc/vsftpd/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.
#
# 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().
#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
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
Доброго времени суток!
Ранее я настраивал ftp на VPS и сохранял все команды для повторной настройки. Но ftp сервер на этот раз не хочет даже авторизировать а если авторизирует локального пользователя то говорит что «нет доступа к этой папке» или «сервер ftp не дал ответа». Я использую такие команды:
sudo mkdir /home/www
sudo mkdir /home/www/file
sudo mkdir /home/www/node
sudo mkdir /var/www
sudo mkdir /var/www/node
sudo chown -R root:rootgroup /home/www/file
sudo chmod 775 /home/www/file
sudo chown -R root:rootgroup /home/www/node
sudo chmod 775 /home/www/node
sudo chown -R root:rootgroup /var/www/node
sudo chmod 775 /var/www/node
sudo chmod a-w /home/www
/home/www
— Общий каталог
/home/www/node
— файлы сайта (в эту папку монтируется каталог /var/www/node)
/home/www/file
— хранение некоторых данных.
При авторизации пользователей с группы rootgroup
он должен получить доступ к созданию папок и файлов в папках file
и node
и удалению всего не считая эти каталоги.
Файл конфигурации:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_root=/home/www
pasv_min_port=40000
pasv_max_port=50000
В /etc/shadow пользователи под которыми я пытаюсь залогиниться имеются.
Помогите с настройкой ftp. Буду очень благодарен!
I configured my ftp user’s home dir to /var/www
and set a password but I cannot login with ftp 127.0.0.1
, it keep giving me 530 Login incorrect.
Why is this? I’m sure I have typed the password right.
edit 1
My config /etc/vsftpd.conf
looks like:
# 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
#
# 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=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
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES
and permissions are set to 777
:
reg@regDesktopHome:~$ ls -ld /var/www/
drwxrwxrwx 11 root root 4096 Feb 19 20:42 /var/www/
And the log file at /var/log/vsftp.log
only says:
Tue Feb 25 21:19:38 2014 [pid 18250] CONNECT: Client "127.0.0.1"
Tue Feb 25 21:19:46 2014 [pid 18249] [ftp] FAIL LOGIN: Client "127.0.0.1"
Oh and syslog-ng doesn’t say anything at /var/log/messages
I can’t get vsfptd
working on Ubuntu 12.04.
my vsftpd.conf
file looks like this, and I try to connect with a local user:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Error message in FileZilla:
Response: 331 Please specify the password.
Command: PASS ****
Response: 530 Login incorrect.
asked Jan 31, 2014 at 18:03
FlorianFlorian
8021 gold badge6 silver badges9 bronze badges
4
Back up the config file before making a change;
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.back
and then edit vsftpd.conf (with vi or nano)
nano /etc/vsftpd.conf
Then make the following change
pam_service_name=ftp
Save your change and restart the ftp server (if you use nano hit CTRL+O & enter to save then CTRL+X to exit)
sudo service vsftpd restart
Source: VSFTPD configuration problems with 12.04
answered Jan 31, 2014 at 18:35
AzkerMAzkerM
10k6 gold badges30 silver badges51 bronze badges
9
By default vsFTPd uses the file /etc/pam.d/vsftpd
.
This file by default requires FTP users to have a shell listed in /etc/shells
and requires them not to be listed in /etc/ftpusers
.
If you check those 2 things your probably find what the problem is.
answered Sep 4, 2015 at 14:45
4
I did not need to change the vsftpd.conf
. Only needed to make sure that a shell was set in my /etc/passwd
file, that also was lited in /etc/shells
.
So basically after useradd
without a shell I needed to make sure the home directory was created and that the user had /bin/bash
as it’s shell.
galoget
2,9032 gold badges20 silver badges24 bronze badges
answered Oct 31, 2015 at 11:49
DuncanDuncan
811 silver badge2 bronze badges
1
I met this problem when I tried to login in with root
and I just solved it.
vsftpd: version 3.0.2
Solution:
Check the following file (it contains list of users disallowed FTP access):
/etc/ftpusers
In my case, I commented out root
from the file, then it worked.
galoget
2,9032 gold badges20 silver badges24 bronze badges
answered Dec 3, 2015 at 8:27
2
Please make some changes in /etc/vsftpd.conf
:
pam_service_name=ftp
If you want to set access by default /var/www
directory for local user you can do that with below line:
local_root=/var/www
Now save and exit.
Restart vsftpd
server using:
sudo service vsftpd restart
galoget
2,9032 gold badges20 silver badges24 bronze badges
answered Sep 7, 2015 at 9:05
1
The suggested resolution did not work for me. I gave up on the ftp
user, and switched my attention to the ubuntu
user. I made sure there was a password associated with the ubuntu
user.
I made sure to enable passive mode, and set local_enable=YES
in the vsftpd.conf
file.
I was able to authenticate just fine using the ubuntu
account. And I successfully uploaded a large file to my Amazon Ubuntu FTP server. Clearly there was something amiss with the ftp
user.
Ron
20.2k6 gold badges55 silver badges72 bronze badges
answered May 6, 2015 at 5:02
I used Ubuntu 18.04 and LetsEncrypt certificates for TLS encryption. What worked was changing the name of the pam_service_name=ftp
the error I was getting in Filezilla was:
"GnuTLS error -15": An unexpected TLS packet was received.
Reference: FTPS set up in ubuntu 18.04
galoget
2,9032 gold badges20 silver badges24 bronze badges
answered Aug 27, 2019 at 5:37
Добрый день.
Ситуация следующая:
1. Есть девайс http://en.wikipedia.org/wiki/MyBook с установленным внутри
Код: Выделить всё
# uname -a
Linux MyBook 2.6.17.14 #1 PREEMPT Fri Jan 18 10:40:25 GMT 2008 armv5tejl GNU/Linux
На этот девайс необходимо поставить ftp, мой выбор пал на sftpd.
2. Необходимо предоставить доступ для системных пользователей, точнее сказать для пользователя ftp:
Код: Выделить всё
# id ftp
uid=108(ftp) gid=500(users) groups=500(users)
Конфиг:
Код: Выделить всё
# vi /opt/etc/vsftpd.conf
listen=NO
listen_address=10.200.0.48
pam_service_name=vsftpd
anonymous_enable=NO
local_enable=YES
write_enable=YES
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
anon_root=/var/ftp/anonymous
dirmessage_enable=YES
connect_from_port_20=YES
chown_uploads=YES
chown_username=ftp
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=12000
nopriv_user=ftp
ascii_upload_enable=NO
ascii_download_enable=NO
ftpd_banner=Hello.
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
Код: Выделить всё
]# cat /etc/vsftpd/vusers/ftp
local_root=/shares/internal/backup
При коннекте на данный фтп происходит следующее:
Код: Выделить всё
# ftp ftp@10.200.0.48
Connected to 10.200.0.48.
220 Hello.
331 Please specify the password.
Password:
530 Login incorrect.
ftp: Login failed.
Логи системы:
Код: Выделить всё
# tail /var/log/vsftpd.log
Tue Feb 22 14:18:15 2011 [pid 5922] CONNECT: Client "10.200.0.1"
Tue Feb 22 14:18:18 2011 [pid 5921] [ftp] FAIL LOGIN: Client "10.200.0.1"
Прошу помочь разобраться, т.к. не понимаю причину отказа авторизации.
I also ran into the same strange behaviour where a FTP-User configured with
# finger <user>
Login: <user> Name:
Directory: /home/user-dir Shell: /sbin/nologin
Never logged in.
No mail.
No Plan.
on one System is able to log in and on the other not.
In extention to the Answer of @KateYoak it turned out that the /etc/shells
File was different and did not include the /sbin/nologin
shell.
which made the PAM Authentication in /etc/pam.d/vsftpd
auth required pam_shells.so
fail
By just adding to the /etc/shells
File the missing lines
/sbin/nologin
/usr/sbin/nologin
the check in /etc/pam.d/vsftpd
worked.
So a working /etc/shells
File should have:
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
In more recent Versions (Centos8) the /etc/shells
only contains:
# cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
and User Accounts in those Systems are created with the /usr/bin/false
Shell:
# cat /etc/passwd|grep -i ftp_user01
ftp_user01:x:1004:1004:FTP Account for user01:/home/user01:/usr/bin/false
Even though this configuration will not give automatically FTP Login what way.
$ ftp ftp-server02.domain.com
Connected to ftp-server02.domain.com (ip.add.re.ss).
220 FTP Service of Server ftp-server02
Name (ftp-server02.domain.com:local_user02): ftp_user01
331 Password required for ftp_user01
Password:
530 Login incorrect.
Login failed.
Remote system type is UNIX.
Using binary mode to transfer files.
It is always required to insert /usr/bin/false
into /etc/shells
So the Minimum Configuration to get the FTP working should be:
# cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/usr/bin/false
Site Note about the thought from @Greeso :
The man
pages on /sbin/nologin
explain:
man page nologin
:
nologin displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny
login access to an account.
nologin is a per-account way to disable login (usually used for
system accounts like http or ftp).
So actually running the /usr/sbin/nologin
Command it displays:
$ /usr/sbin/nologin ; echo "res: '$?'"
This account is currently not available.
res: '1'
So bots that try a bruteforce attack on the system and get this message can use it to conclude that the Account exists in the System and that the Login is for a FTP or HTTP Service.
So you can understand the change as a strategy to harden the System Security.
I also ran into the same strange behaviour where a FTP-User configured with
# finger <user>
Login: <user> Name:
Directory: /home/user-dir Shell: /sbin/nologin
Never logged in.
No mail.
No Plan.
on one System is able to log in and on the other not.
In extention to the Answer of @KateYoak it turned out that the /etc/shells
File was different and did not include the /sbin/nologin
shell.
which made the PAM Authentication in /etc/pam.d/vsftpd
auth required pam_shells.so
fail
By just adding to the /etc/shells
File the missing lines
/sbin/nologin
/usr/sbin/nologin
the check in /etc/pam.d/vsftpd
worked.
So a working /etc/shells
File should have:
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
In more recent Versions (Centos8) the /etc/shells
only contains:
# cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
and User Accounts in those Systems are created with the /usr/bin/false
Shell:
# cat /etc/passwd|grep -i ftp_user01
ftp_user01:x:1004:1004:FTP Account for user01:/home/user01:/usr/bin/false
Even though this configuration will not give automatically FTP Login what way.
$ ftp ftp-server02.domain.com
Connected to ftp-server02.domain.com (ip.add.re.ss).
220 FTP Service of Server ftp-server02
Name (ftp-server02.domain.com:local_user02): ftp_user01
331 Password required for ftp_user01
Password:
530 Login incorrect.
Login failed.
Remote system type is UNIX.
Using binary mode to transfer files.
It is always required to insert /usr/bin/false
into /etc/shells
So the Minimum Configuration to get the FTP working should be:
# cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/usr/bin/false
Site Note about the thought from @Greeso :
The man
pages on /sbin/nologin
explain:
man page nologin
:
nologin displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny
login access to an account.
nologin is a per-account way to disable login (usually used for
system accounts like http or ftp).
So actually running the /usr/sbin/nologin
Command it displays:
$ /usr/sbin/nologin ; echo "res: '$?'"
This account is currently not available.
res: '1'
So bots that try a bruteforce attack on the system and get this message can use it to conclude that the Account exists in the System and that the Login is for a FTP or HTTP Service.
So you can understand the change as a strategy to harden the System Security.
I configured my ftp user’s home dir to /var/www
and set a password but I cannot login with ftp 127.0.0.1
, it keep giving me 530 Login incorrect.
Why is this? I’m sure I have typed the password right.
edit 1
My config /etc/vsftpd.conf
looks like:
# 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
#
# 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=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
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES
and permissions are set to 777
:
reg@regDesktopHome:~$ ls -ld /var/www/
drwxrwxrwx 11 root root 4096 Feb 19 20:42 /var/www/
And the log file at /var/log/vsftp.log
only says:
Tue Feb 25 21:19:38 2014 [pid 18250] CONNECT: Client "127.0.0.1"
Tue Feb 25 21:19:46 2014 [pid 18249] [ftp] FAIL LOGIN: Client "127.0.0.1"
Oh and syslog-ng doesn’t say anything at /var/log/messages
Доброго времени суток!
Ранее я настраивал ftp на VPS и сохранял все команды для повторной настройки. Но ftp сервер на этот раз не хочет даже авторизировать а если авторизирует локального пользователя то говорит что «нет доступа к этой папке» или «сервер ftp не дал ответа». Я использую такие команды:
sudo mkdir /home/www
sudo mkdir /home/www/file
sudo mkdir /home/www/node
sudo mkdir /var/www
sudo mkdir /var/www/node
sudo chown -R root:rootgroup /home/www/file
sudo chmod 775 /home/www/file
sudo chown -R root:rootgroup /home/www/node
sudo chmod 775 /home/www/node
sudo chown -R root:rootgroup /var/www/node
sudo chmod 775 /var/www/node
sudo chmod a-w /home/www
/home/www
— Общий каталог
/home/www/node
— файлы сайта (в эту папку монтируется каталог /var/www/node)
/home/www/file
— хранение некоторых данных.
При авторизации пользователей с группы rootgroup
он должен получить доступ к созданию папок и файлов в папках file
и node
и удалению всего не считая эти каталоги.
Файл конфигурации:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_root=/home/www
pasv_min_port=40000
pasv_max_port=50000
В /etc/shadow пользователи под которыми я пытаюсь залогиниться имеются.
Помогите с настройкой ftp. Буду очень благодарен!
I’m trying to get a vsftpd server set up on CentOS 5.3 x64. I’m not able to get any local user login’s to work. Here is my vsftpd.conf:
local_enable=YES
write_enable=YES
pam_service_name=vsftpd
connect_from_port_20=YES
listen=YES
pam_service_name=vsftpd
xferlog_std_format=NO
log_ftp_protocol=YES
chroot_local_user=YES
Here is the output of vsftp.log:
Mon Sep 13 23:34:44 2010 [pid 19243] CONNECT: Client "10.0.1.138"
Mon Sep 13 23:34:44 2010 [pid 19243] FTP response: Client "10.0.1.138", "220 (vsFTPd 2.0.5)"
Mon Sep 13 23:34:44 2010 [pid 19243] FTP command: Client "10.0.1.138", "USER dwelch"
Mon Sep 13 23:34:44 2010 [pid 19243] [dwelch] FTP response: Client "10.0.1.138", "331 Please specify the password."
Mon Sep 13 23:34:44 2010 [pid 19243] [dwelch] FTP command: Client "10.0.1.138", "PASS <password>"
Mon Sep 13 23:34:44 2010 [pid 19242] [dwelch] FAIL LOGIN: Client "10.0.1.138"
Mon Sep 13 23:34:45 2010 [pid 19243] [dwelch] FTP response: Client "10.0.1.138", "530 Login incorrect."
And the output of the secure log:
Sep 13 17:40:50 intra vsftpd: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=dwelch rhost=10.0.1.138 user=dwelch
It looks like pam is not authenticating the user. Here is my /etc/pam.d/vsftp file:
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so
Can anyone see what I’m missing? Thanks.