FTP-сервер ProFTPD

Регистрация на сайте
GRATIS форум > Архивы > ** Компьютер
gratis
Кто то ставил? Или может лучше иначе FTP сервер сделать?
Duke
gratis
Я пользовался [Для просмотра ссылки зарегистрируйтесь]. Но разница вообщем не большая.
Будут вопросы, бум думать. А вообще для экспериментов рекомендую прогу VMware Workstation(могу поделиться). Это эмулятор PC.Вот там можно хоть с 10 разных ОСей наставить.
gratis
Duke
А порт 20, 21 по умолчанию открыты или нет? Как их открыть и проверить что они открыты?
Duke
gratis
QUOTE
А порт 20, 21 по умолчанию открыты или нет
Вообще порты должен кто то открыть. В винде это службы. В линухе так называемые "демоны"(те же службы). Т.е если служба запущена, то она окрывает. Хотя тут ещё файрвол может их не выпустить. т.е они будут открыты, но с наружи не видны. Вайрвол там скорее всего iptables хотя ХЗ. Цепочки правил iptables настраиваются в файле iptables где то в /etc/ (в разных дистриб. по разному)
QUOTE
Как их открыть и проверить что они открыты?
Открыть запустив соответствующую службу. Проверить можно коммандой netstat -l
Ещё не мешало бы периодически сканировать сервак сканером портов с удалённого компа.
gratis
QUOTE
iptables

ipchains
[Для просмотра ссылки зарегистрируйтесь]
Duke
gratis
QUOTE
ipchains
давненько я его не пользовал. буду на работе в понедельник, могу поискать готовы решения цепочек. ежли найду могу выслать.

воо, это значит открыты порты
110 - pop3 для получения почты
80 - http веб сервер
22 - ssh типа удалённая консоль
25 - SMTP отправка почты
pop3s - блин...не помню чего енто....

21 порт FTP не открыт. видимо служба не запущена.
gratis
Duke
QUOTE
21 порт FTP не открыт. видимо служба не запущена

Угу. Поэтому и протестить фтп не получается.
Duke
gratis
Кстать посмотреть открыт порт или нет можно командой
CODE
telnet ip port

В твоём случае это
CODE
telnet 127.0.0.1 21
Телнетиться можно к любому tcp порту.
QUOTE
Поэтому и протестить фтп не получается
а что ? демон не запускается ?
gratis
Duke
QUOTE
а что ? демон не запускается ?

Запускается unsure.gif
Но что там с настройками ещё не понял smile.gif
Duke
gratis
Ну удачи. Ежли чего, всегда рад.....
gratis
Duke
[Для просмотра ссылки зарегистрируйтесь]
Duke
gratis
Ага....ништяк....порт открыт....
Я ща даже приконектился к нему smile.gif но меня не пустили, сказали "логин инкорект" unsure.gif biggrin.gif
Кстать там нужно убрать строку приветствия. Чтоб версию ФТП сервера не выдавала!!
gratis
Duke
Меня тоже не пускает sad.gif
Думаю как его настроить smile.gif
Duke
gratis
QUOTE
Меня тоже не пускает
ну под root по умолчанию и не должно пускать. Нужено права выставлять.
QUOTE
Думаю как его настроить
ты вообще ? спиш ?
gratis
Duke
QUOTE
Нужено права выставлять.

Вот и думаю куда и как unsure.gif
QUOTE
ты вообще ? спиш ?

Сплю aga.gif


Даже для анонима не получается huh.gif
CODE

<Anonymous ~>
User ftp
Group ftp
RequireValidShell off
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayFirstChdir .message
<Directory *>
<Limit WRITE>
DenyAll
</Limit>
</Directory>
</Anonymous>
Duke
gratis
у мня vsFTP .
а у тебя,что за демон ?
gratis
Duke
ProFTPD smile.gif
Duke
gratis
QUOTE
ProFTPD
никогда не видел sad.gif но попытаюсь догнять......

QUOTE
<Anonymous ~>
Тут помойму путь к директории для ананимных юзеров нужна !
Примерно так :
CODE
< Anonymous /path/to/anonymous/users>


Кстать а группа ftp то есть ?
gratis
Duke
QUOTE
Кстать а группа ftp то есть ?

Нету. Как создать? smile.gif
gratis
Начал установку с фтп сервера и ей заканчиваю laugh.gif
Засада doh.gif
Duke
QUOTE
Нету. Как создать

groupadd [имя_группы] -Создать новую группу пользователей на системе.
userdel [имя_пользователя] -Удалить пользователя из системы (нужны права root)
adduser [имя_пользователя] или useradd [имя_пользователя] -Зарегистрировать нового пользователя (под root) Директория пользователя находится в каталоге /home/имя_пользователя.
passwd - Изменить пароль.Если под root , то можно passwd [имя_пользователя]


Вообщем делаем примерно так:
CODE

groupadd ftp - добавляем группу
useradd ftp -s /sbin/nologin -d /dev/null -g ftp  - добавляем юзера


Salagin
gratis
proftpd.conf в студию!
Тебе анонимный надо сделать доступ что ли? Или авторизированный?
gratis
Salagin
Нужен авторизированный
CODE

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "ftp"
ServerType                      standalone
DefaultServer                   on
TimeoutSession                  86400
#UseReverseDNS off
#ServerIdent on "FTP server"
#AllowOverwrite on
#RootLogin on

# Port 21 is the standard FTP port.
Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    30

# Set the user and group under which the server will run.
User                            nobody
Group                           nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.
#<Limit LOGIN>
#AllowAll
#AllowUser root
#</Limit>

#<Limit READ DIRS>
#IgnoreHidden on
#</Limit>

#<Limit SITE_CHGRP SITE_CHMOD>
#AllowAll
#</Limit>

#<Directory />
#AllowOverwrite          on
#</Directory>
# Bar use of SITE CHMOD by default
#<Limit SITE_CHMOD>
#  AllowAll
#</Limit>

# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~>
 User                          ftp
 Group                         ftp
#AnonRequirePassword off
RequireValidShell off
 # We want clients to be able to login with "anonymous" as well as "ftp"
 UserAlias                     anonymous ftp

 # Limit the maximum number of anonymous logins
 MaxClients                    10

 # We want 'welcome.msg' displayed at login, and '.message' displayed
 # in each newly chdired directory.
 DisplayLogin                  welcome.msg
 DisplayFirstChdir             .message

 # Limit WRITE everywhere in the anonymous chroot
<Limit LOGIN>
AllowAll
</Limit>
</Anonymous>
Salagin
man proftpd.conf конечно рулит...
Во первых, не вижу такого
CODE

AuthUserFile                    /etc/proftpd/passwd.ftp
AuthGroupFile                   /etc/proftpd/group.ftp

Во-вторых, коменть все, что относиццо к анонимному доступу.
В-третьих, относящеяся собссна, к юзверю который будет заходить
CODE

<tv /usr/local/apache/htdocs/TV>
   RequireValidShell          off
   User                       tv
   Group                      wwwftp
   UserAlias                  tv
   MaxClients                 500 "Sorry, max %m users -- try again later"
   DisplayLogin               .welcome.msg
   <Limit LOGIN>
      AllowAll
   </Limit>
   <Limit WRITE>
      DenyAll
   </Limit>
</tv>

Вот основа, прописываешь группу и юзверя в ней (никакого отношения не имеет к /etc/passwd!), создаешь ему пароль... вроде все..
gratis
Salagin
QUOTE
создаешь ему пароль

QUOTE
AuthUserFile/etc/proftpd/passwd.ftp

А как его создать он же хешированный?
Duke
Смотрим готовые примеры конфигов [Для просмотра ссылки зарегистрируйтесь]
gratis
Duke
Смотрели уже не раз aga.gif
Загвоздка в юзерах smile.gif
Salagin
gratis
Для создания хешированного пароля воспользуйся make_pass_ftp.pl, должна быть такой скриптик...
Добавлено:
Или я его сам наваял? blink.gif
Duke
Salagin
А разве не достаточно создать группу и юзера ?
QUOTE
Или я его сам наваял?
во во...я сам вечно путаюсь..... под руками только самособранный лин
gratis
Salagin
QUOTE
make_pass_ftp.pl

У меня такого нет smile.gif
Salagin
Duke
А пароль? Тут не useradd пользуешся, а прописываешь в файлах логин и пароль, созданный make_pass_ftp.pl
gratis
Salagin
А что в нем одна функция?
Добавлено:
А мой хешированный пароль с форумской базы годится? biggrin.gif
Duke
Salagin
Непомню какой ФТП демон настраивл,но там ФТП пользоваться мог любой юзер входящий в группу ФТП.
и помойму тут достаточно создать группу и юзера в эту группу.
Хотя МБ я ошибаюсь....надо пробовать.
Salagin
gratis
QUOTE
А что в нем одна функция?

Он только для этого и предназначен... для хеширования пароля
Давай посмотрю laugh.gif
gratis
Salagin
QUOTE
Он только для этого и предназначен... для хеширования пароля

У меня нет такого файла aga.gif
Salagin
gratis
QUOTE
У меня нет такого файла

Напеши... laugh.gif
Вот
CODE

cat make_pass_ftp.pl
#!/usr/bin/perl
print "User password --> ";
$c=<>;
($u_ps)=split('\n',$c);
srand();
for($i=0;$i<2;++$i)
   {
   $k=int(rand(127));
   if($k < 32)
       {
       $k=$k+50;
       }
   $kc[$i]=chr($k);
   }
$kl=join("",$kc[0],$kc[1]);
$ps_c=crypt($u_ps,$kl);
print "$ps_c\n";

Запеши
Duke
Ща настроил у себя ! всё работает !
Создаём группу ftp !
Создаём пользователя и загоняем его в группу ftp.
Всё ! Можно работать !

CODE

# Allow anonymous FTP?
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.
di######sage_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
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 turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#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_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

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES

По безопастности ничего не мутил. Так что нужно дорабатывать.
gratis
Нашел чем файлы делать но ничего пока не получается smiles (11).gif
CODE

The ftpasswd program can create and update files for both AuthUserFile and AuthGroupFile. When it is used for the first time, the program will create the necessary file. If that file already exists, ftpasswd will update it with the new information.

ftpasswd must first know what type of file to create. Use either the --passwd option (for handling AuthUserFiles), or the --group option (for handling AuthGroupFiles); this is required.

When creating an AuthUserFile, the following options are also required: --name, --uid, --home, and --shell. This information is required by proftpd to authenticate a user. The optional parameters for an AuthUserFile include --gid (defaults to the given --uid argument when not provided) and --gecos (not used by proftpd at all). For example:

 ftpasswd --passwd --name=bob --uid=1001 --home=/home/bob --shell=/bin/false

creates an account for user bob. To create a file with a name or location other than the default (which, for --passwd mode is ftpd.passwd), use the --file option. For example, to create the alternate password file in /usr/local/etc/ftpd/passwd:
 ftpasswd --passwd --file=/usr/local/etc/ftpd/passwd --name=bob --uid=1001 --home=/home/bob \
   --shell=/bin/false

For AuthGroupFiles, use --group:

 ftpasswd --group --name=group-name --gid=group-id --member=user-member1  \
   --member=user-member2 ... --member=user-memberN

The most common change to these files is made to AuthUserFiles, to change a user's password. The --change-password option was provided just for this scenario:

 ftpasswd --passwd --name=user --change-password

Добавлено:
Duke
Что это? Конфиг у тебя совсем не такой.
Duke
gratis
QUOTE
Что это? Конфиг у тебя совсем не такой
Возможно vsftpd поновее. Это в сборке red hat 9.
А ты мой конфиг не пробовал ? МОж прокатит biggrin.gif
Salagin
gratis
У тебя что валяеццо в etc директории proftpd?
Вот у меня
ls
group.admin.ftp
make_pass_ftp.pl*
passwd.ftp
group.ftp
passwd.admin.ftp
proftpd.conf
Хотя, насколько я понял passwd.ftp и group.ftp содержат записи аналогичную записи в /etc/passwd и /etc/group для группы и пользователя ftp...
а вот в passwd.admin.ftp как раз и находяццо такие записи (логин, пароль, номер юзверя, номер группы, исходная папка, оболочка)
tv:_o5uGXTiPMq9s:2001:2000::/usr/local/apache/htdocs/TV:/bin/bash
в group.admin.ftp запись (типа группа виртуальная)
upload::2000:
К сожалению, не помню, как и что конкретно делал, но сейчас добавляю только логин и пароль в passwd.admin.ftp и все
У Дюка конфа для vsftpd

Добавлено:
Сорри, забыл кусок конфига, мы же виртуальных юзвере делаем поетому
CODE

<VirtualHost твой IP>
Port                            2021
AuthUserFile                    /etc/proftpd/passwd.admin.ftp
AuthGroupFile                   /etc/proftpd/group.admin.ftp
DefaultRoot                     ~
RootLogin                       on
Umask                           022 022
AllowOverwrite                  on
</VirtualHost>
Duke
Salagin
QUOTE
У Дюка конфа для vsftpd
ага...запутался совсем blink.gif
QUOTE
Port                            2021
а тут пробел не нужен ? Так надо ?
gratis
QUOTE
У тебя что валяеццо в etc директории proftpd?

group.ftp passwd.ftp proftpd.conf
Как не экспериментирую ошибка одна и таже 530 Login incorrect.

А как посмотреть какие группы и пользователи есть в линуксе?
Salagin
gratis
cat /etc/group laugh.gif
Пользователи фтп не имеют никакого отношения в реальным пользователям в системе!
Слушай, можно не париццо, разрешить доступ только с твоего ip и разрешить анонимусу писать, создавать каталоги и прочее.
gratis
Salagin
А у тебя какой
ServerType standalone
Salagin
gratis
Ну да, типа inetd его запускает aga.gif
gratis
Salagin
Если
ServerType inetd
не запускается и пишет - fatal: Socket operation on non-socket
Salagin
gratis
Не я про то, что если тип сервера standalone, то он запускаеццо чере inetd, при старте компа, то есть сервак работает постоянно, есть еще один тип, тот я не помню, для динамического ip, да оно тебе не надо вроде....
Добавлено:
И чтоб много не флудить, стукнись в асю
gratis
Salagin
Если inetd то он слушает порт и при запросе запускает proftpd?
А если standalone то proftpd работает постоянно? biggrin.gif

эх... coffee.gif
Duke
gratis
Проблемма решена ? а то я уж думаю proftpd ставить !
Кстать если чего то [Для просмотра ссылки зарегистрируйтесь] и [Для просмотра ссылки зарегистрируйтесь]
gratis
Duke
Ещё не решена sad.gif
Ничего не получается.
Duke
gratis
QUOTE
Ещё не решена
а в чём сейчас загвоздка ?
Завтра,если время будет, поставлю у себя proftpd.
Кстать,а может vsftpd поставить ? там всё гораздо проще!
gratis
Duke
QUOTE
а в чём сейчас загвоздка ?

Не проходит авторизация.
220 ProFTPD Server (ProFTPD Default Installation)
USER gratis
331 Password required for gratis.
PASS (hidden)
530 Login incorrect.
QUIT
221 Goodbye.
QUOTE
Кстать,а может vsftpd поставить ?

Если не получится с этим придется.
Duke
gratis
а хотяб ананимно заходит ?
QUOTE
Если не получится с этим придется
помойму лучший вариант ! вчера настроил за 15 минут. Авторизируются локальные юзеры.
gratis
Duke
QUOTE
а хотяб ананимно заходит ?

no2.gif
Duke
gratis
тут просто Салагин вариант предлагал. ананимный вход только с твоего IP. На первое время -вариант.
gratis
Duke
Если получится анонимно то авторизацию думаю сделать получится smile.gif
gratis
Поставил vsftpd, пишет 500 OOPS: could not bind listening IPv4 socket
gratis
Через inetd работает, а как демон (listen=YES) не запускается.
Duke
QUOTE
пишет 500 OOPS: could not bind listening IPv4 socket
это у тебя ProFTPD занимает порт 21. Который нужен для vsftpd wink.gif Сначало освободи порт.
Salagin
gratis
Анонимно должен работать! Юзверя ftp из ftpusers выкинул?
Salagin
Все блин, разобрался... в прошлый раз видать я другую конфу наковырял.
В общем, запустив режим отладки, ( proftpd -n -d 9) (спасибо Duke за ссылку) читаю:
mod_auth_file/0.8.2: using passwd file '/etc/proftpd/passwd.ftp'
mod_auth_file/0.8.2: using group file '/etc/proftpd/group.ftp'
То есть откуда он берет юзверей и группы.
В group.ftp добавил
upload::2000: - виртуальная группа
в passwd.ftp добавил
karakol:EKlihXpwZI1dY:2000:2000::/usr/local/apache/htdocs/up:/bin/bash
Перезапускаю proftpd
kill -HUP
конект
Connected to xxx.xxx.xxx.xxx...
220 ProFTPD 1.2.8 Server (issyk-kul.kg ProFtpD Server) [issyk-kul.kg]
Name (xx.xx.xx.xxx:root): karakol
331 Password required for karakol.
Password:
230 User karakol logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
Все.
Duke
gratis
Смотрю vsFTPd запустил wink.gif и даже ананимно пускает thumbup.gif
gratis
Duke
QUOTE
и даже ананимно пускает

Анонимно пускает, а вот как файл с юзерами сделать не понятно
QUOTE

db_load -T -t hash -f logins.txt /etc/vsftpd_login.db

Salagin
QUOTE
mod_auth_file/0.8.2: using passwd file '/etc/proftpd/passwd.ftp' mod_auth_file/0.8.2: using group file '/etc/proftpd/group.ftp'

У меня такое не пишет хоть и прописано
AuthuserFile /usr/local/etc/passwd.ftp
AuthGroupFile /usr/local/etc/group.ftp

А где у тебя прописано в глобальных свойствах или в виртуалхост?
Salagin
gratis
Ты про proFTP или про vsFTP речь ведешь?
gratis
Salagin
к тебе proFTP
к Duke про vsFTP umnik2.gif
Salagin
gratis
Дык мож тебе proftpd.conf надо дать?
gratis
Salagin
Дай мне что-нибудь, что будет работать biggrin.gif smiles (14).gif
я в печале... smiles (11).gif
Salagin
Ну на
CODE

cat /etc/proftpd/proftpd.conf
ServerName                      "Как там у тебя называеццо ProFtpD Server"
ServerType                      standalone
DefaultServer                   on
Port                            21
MaxInstances                    50
TimeoutStalled                  600
User                            nobody
Group                           nogroup
SystemLog                       /var/log/proftpd.log - проверь пути!
TransferLog                     /var/log/proftpd-xfer.log
PidFile                         /var/run/proftpd.pid
AuthUserFile                    /etc/proftpd/passwd.ftp  - Поменяй на свои
AuthGroupFile                   /etc/proftpd/group.ftp
Classes                         on
Class                           default limit 500

<Anonymous /home/ftp>
   RequireValidShell           off
   User                        ftp
   Group                       ftp
UserAlias                       anonymous ftp
   MaxClients                  500 "Sorry, max %m users -- try again later"
   DisplayLogin                .welcome.msg
   <Limit LOGIN>
       AllowAll
   </Limit>
<Limit WRITE>
       DenyAll
   </Limit>
</Anonymous>

<VirtualHost Твой ip>
Port                            2021
AuthUserFile                    /etc/proftpd/passwd.admin.ftp
AuthGroupFile                   /etc/proftpd/group.admin.ftp
DefaultRoot                     ~
RootLogin                       on
Umask                           022 022
AllowOverwrite                  on
</VirtualHost>

И вперед
Duke
gratis
QUOTE
db_load -T -t hash -f logins.txt /etc/vsftpd_login.db
видимо...у мня сразу появились dry.gif
Вот по теме:
CODE
Step 1) Create the virtual users database.

db_load -T -t hash -f logins.txt /etc/vsftpd_login.db

Содержание logins.txt
tom
foo
fred
bar

chmod 600 /etc/vsftpd_login.db


Step 2) Create a PAM file which uses your new database.

auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login

cp vsftpd.pam /etc/pam.d/vsftp

Step 3) Set up the location of the files for the virtual users.

useradd -d /home/ftpsite virtual
cp /etc/hosts /home/ftpsite
chown virtual.virtual /home/ftpsite/hosts

Step 4) Create your vsftpd.conf config file.

anonymous_enable=NO
local_enable=YES
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
listen_port=10021
pasv_min_port=30000
pasv_max_port=30999

Copy the example vsftpd.conf file to /etc:

cp vsftpd.conf /etc/


Step 5) Start up vsftpd.
./vsftpd


Step 6) Test.


ftp localhost 10021
Connected to localhost (127.0.0.1).
220 ready, dude (vsFTPd 1.1.0: beat me, break me)
Name (localhost:chris): tom
331 Please specify the password.
Password:

Далее я ввожу foo и у меня
530 Login incorrect
Login failed.
Как описано в предыдущем письме, причём никакие извращения с файлом login.txt не помогают. Также пробовал использовать разные версии db_load тоже ничего.
messages пишет, что pam_userdb не смог обнаружить пароль :(.

230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> ls
227 Entering Passive Mode (127,0,0,1,117,135)
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).
ftp> size hosts
213 147
ftp>


Мой vsftpd.conf
CODE
# 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.
di######sage_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
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 turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#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_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

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES


мой user_list
CODE
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody  


мой ftpusers
CODE
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody  


Вхожу как ананим или admin
gratis
Failed binding to 0.0.0.0, port 21: Address already in use
А как посмотреть кто занял порт и как убить этот процесс?
Добавлено:
QUOTE
db_load

Где взять этот файл?
Salagin
gratis
Кто-то из ftp ... килль нафиг..
gratis
Salagin
QUOTE
килль нафиг..

Как? huh.gif
gratis
netstat -ap
tcp 0 0 *:ftp *:* LISTEN 24830/xinetd
Тоесть демон можно запустить только через xinetd?
Salagin
gratis
А ServerType что стоит? standalone или inetd?
gratis
Salagin
Стоит standalone, с inetd тоже не работает, наверное отличается от xinetd unsure.gif
А что у тебя порт слушает?

Но теперь я знаю куда копать aga.gif
Salagin
gratis
У меня Proftpd слушает 21 порт. А если ты 2 ftp поставил, теперь кого то придеццо глушить...
QUOTE
Но теперь я знаю куда копать

Это самое главное
gratis
Salagin
А как деинсталлировать в линуксе? huh.gif
Salagin
Убей папку с конфами, выкинь из скриптов запуска, и из bin и sbin папок.
Все пошло?
Duke
QUOTE
А если ты 2 ftp поставил, теперь кого то придеццо глушить
aga.gif
gratis
на каком сервере остановился всётки ?
gratis
Salagin
QUOTE
Убей папку с конфами, выкинь из скриптов запуска, и из bin и sbin папок.

да? shocking.gif

а что такое make distclean ?

Duke
QUOTE
на каком сервере остановился всётки ?

Ещё никакой не настроил, щас буду пытаться aga.gif
Duke
wink.gif gratis
вообщем настроил с нуля vsFTPd !

Должно работать !!!

короче ....заливай этот конфиг /etc/vsftpd/vsftpd.conf (ольше в этой папки файлов нет):
CODE
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are very paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
#
# Allow anonymous FTP?
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.
di######sage_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
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 turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#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_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

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES


Далее заводим юзера :
CODE
useradd gratis -s /bin/bash -d /home/gratis -g users

задаём пароль для gratis :
CODE
passwd gratis


ВСЁ..... будет работать !
Добавлено:
Ах..да....
ещё НУЖНЫ ОБЯЗАТЕЛЬНО 2 файла !
/etc/vsftpd.ftpusers
CODE

# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody


и есчо
/etc/vsftpd.user_list
CODE

# 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


ps.gif
И ещё! Если установлено 2 ФТП сервака не забывай один из них останавливать,когда работаеш с другим ! А иначе запарят ошибки типа :
CODE

500 OOPS: could not bind listening IPv4 socket
Подключение к узлу утеряно.

gratis
Вот теперь всё работает
[Для просмотра ссылки зарегистрируйтесь]
Duke
gratis
QUOTE
Вот теперь всё работает
что всё ? и авторизацию зделал на proftpd ?
gratis
Duke
QUOTE
что всё ?

Оба ftp сервера. Только на vsFTPd не получается сделать юзеров, только анонима. Как ты сказал не получается, а как в мануале описано - нету файла такого.
Duke
gratis
QUOTE
Как ты сказал не получается
а как именно не получается ? где загвоздка ?
Юзеры создаются ?
Salagin
gratis
А с Proftpd разобрался? или тоже что то не фурычит?
gratis
Duke
Так как ты описал не создаются, а в документации написано что их создавать надо так
db_load -T -t hash -f logins.txt /etc/vsftpd_login.db
а файла db_load у меня нет
Salagin
Вроде работает нормально. Копаюсь в настройках.
Например если в файле юзеров стоит директория home юзера туда и кидает, но если запросить корневой каталог по фтп то она покажет всё что есть smile.gif
Duke
gratis
QUOTE
Так как ты описал не создаются

должны создаваться ! это стандартные коммнды для Линуха! в каком месте затык ?
может создаёш юзера который уже есть в системе ?
QUOTE
а файла db_load у меня нет
у меня тоже ничего такого нет. У тя какая версия ?
хотя разз настроил проФТП это уже не важно наверное smile.gif
gratis
Duke
QUOTE
должны создаваться ! это стандартные коммнды для Линуха! в каком месте затык ?
может создаёш юзера который уже есть в системе ?

Зачем мне юзеры в линуксе? Я юзеров должен создать в vsftpd.
Юзер в линуксе нужен только для того чтобы запустить демон с привилегиями данного юзера.
Например я запускаю демона под рутом и все юзеры которые есть в proftpd видят всё содержимое если не задал ограничения в конфигурации фтп сервера.
Чтобы создать анонимуса для безопасности лучше использовать ограниченного юзера и запускать демона с его привилегиями. Доступ к директориям будет контролироваться фтп сервером но даже если в нем что-то упустишь в конфигурациях, линукс не даст демону доступ к файлам так как демон запущен с ограниченными правами.
Duke
gratis
QUOTE
Зачем мне юзеры в линуксе? Я юзеров должен создать в vsftpd
нет
при использовании последнего конфига,который я приводил выше, для доступа к ФТП используются юзеры созданные в Линухе !
QUOTE
и все юзеры которые есть в proftpd видят всё содержимое если не задал ограничения в конфигурации фтп сервера.
незнаю как в proftpd но в всфтпд это решается так :
В конфиге должно быть есчо 3 строки
CODE

chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

И нужно создать файл /etc/vsftpd.chroot_list
он должен быть пустой. Все кто будут вписаны в этот файл смогут гулять по всем каталогам. А остальные ограничаться ТОЛЬКО своими домашними каталогами !

[Для просмотра ссылки зарегистрируйтесь] неплохой материал по части настройки доступа.

ЗЫ
пользователя root не пускают.
gratis
Salagin
А как зайти под рутом? Он же владелец папок и файлов biggrin.gif, ниче не могу редактировать.

RootLogin on

passwd.ftp
root:(хеш):0:0::/root:/bin/false
gratis:(хеш):1001:1001::/usr/local:-/bin/false

group.ftp
root:x:0:root
gratis:x:1001:gratis

Хотя в мануале написано что это глупая идея
vertag.gif
Salagin
gratis
QUOTE
А как зайти под рутом?


QUOTE
это глупая идея

aga.gif
Если не хочешь, чтобы юзер не выходил за пределы своей папки, запрети в Limit кажеццо CWD, не помню точно
Добавлено:
По ssh будешь заходить и редактировать что надо
Флер
Людииииии! sad.gif
Я не могу зайти на FTP, мне говорят нажать анонимный вход.Я нажимала не заходит unsure.gif требует пароль. mad.gif



Флуд ! Здесь тема не о входе на FTP сервера! Ещё одно нарушение и -1 тебе обеспечено !
Duke
Melenki
QUOTE
vsftpd умеет авторизовать только пользователей Linux, пока еще разработчики не связали vsftpd с каким-нить SQL'ем... Поэтому никаких специальных хэш-файлов с паролями для vsftpd-сервиса создавать не надо, используются стандартные /etc/passwd и /etc/shadow.
Да в курсе ! Но обсуждается уже ПроФТП.
Да и уже и с ним вроде как разобрались smile.gif