18 июня 2025, 04:42:36

Новости:

Чтобы загрузить изображение нужно нажать кнопку "ПРЕДВАРИТЕЛЬНЫЙ ПРОСМОТР".


avatar_gratis

FTP-сервер ProFTPD

Автор gratis, 10 марта 2006, 20:40:20

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

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 [Для просмотра ссылки зарегистрируйтесь]...
220 ProFTPD 1.2.8 Server ([Для просмотра ссылки зарегистрируйтесь] ProFtpD Server) [[Для просмотра ссылки зарегистрируйтесь]]
Name ([Для просмотра ссылки зарегистрируйтесь]: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.
Все.
Если к власти не придут красно-коричневые, потому что им помешают зеленые, то власть захватят голубые.

Летят N самолетов, нет N мало -- К и оба реактивные...

Duke

gratis
Смотрю vsFTPd запустил  ;)  и даже ананимно пускает  :thumbup:  

gratis

16 марта 2006, 11:04:47 #62 Последнее редактирование: 16 марта 2006, 11:12:48 от gratis
Duke
Цитироватьи даже ананимно пускает

Анонимно пускает, а вот как файл с юзерами сделать не понятно
Цитировать
db_load -T -t hash -f logins.txt /etc/vsftpd_login.db

Salagin
Цитировать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

А где у тебя прописано в глобальных свойствах или в виртуалхост?
Узнай первым!!! о новых темах и ответах в Telegram канале:  @gratis_forum https://t.me/gratis_forum

Salagin

gratis
Ты про proFTP или про  vsFTP речь ведешь?
Если к власти не придут красно-коричневые, потому что им помешают зеленые, то власть захватят голубые.

Летят N самолетов, нет N мало -- К и оба реактивные...

gratis

Salagin
к тебе proFTP
к Duke про vsFTP :umnik:
Узнай первым!!! о новых темах и ответах в Telegram канале:  @gratis_forum https://t.me/gratis_forum

Salagin

gratis
Дык мож тебе proftpd.conf надо дать?
Если к власти не придут красно-коричневые, потому что им помешают зеленые, то власть захватят голубые.

Летят N самолетов, нет N мало -- К и оба реактивные...

gratis

Salagin
Дай мне что-нибудь, что будет работать :D :smile14:
я в печале... :smile11:
Узнай первым!!! о новых темах и ответах в Telegram канале:  @gratis_forum https://t.me/gratis_forum

Salagin

Ну на

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>

И вперед
Если к власти не придут красно-коричневые, потому что им помешают зеленые, то власть захватят голубые.

Летят N самолетов, нет N мало -- К и оба реактивные...

Duke

16 марта 2006, 12:34:37 #68 Последнее редактирование: 16 марта 2006, 12:36:27 от Duke
gratis
Цитироватьdb_load -T -t hash -f logins.txt /etc/vsftpd_login.db
видимо...у мня сразу появились  <_<
Вот по теме:
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
# 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
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody  


мой ftpusers
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
А как посмотреть кто занял порт и как убить этот процесс?
Добавлено:
Цитироватьdb_load

Где взять этот файл?
Узнай первым!!! о новых темах и ответах в Telegram канале:  @gratis_forum https://t.me/gratis_forum



По всем вопросам пишите по адресу gratispp@mail.ru