QUOTE |
А порт 20, 21 по умолчанию открыты или нет |
QUOTE |
Как их открыть и проверить что они открыты? |
QUOTE |
iptables |
QUOTE |
ipchains |
QUOTE |
21 порт FTP не открыт. видимо служба не запущена |
CODE |
telnet ip port |
CODE |
telnet 127.0.0.1 21 |
QUOTE |
Поэтому и протестить фтп не получается |
QUOTE |
а что ? демон не запускается ? |
QUOTE |
Меня тоже не пускает |
QUOTE |
Думаю как его настроить |
QUOTE |
Нужено права выставлять. |
QUOTE |
ты вообще ? спиш ? |
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> |
QUOTE |
ProFTPD |
QUOTE |
<Anonymous ~> |
CODE |
< Anonymous /path/to/anonymous/users> |
QUOTE |
Кстать а группа ftp то есть ? |
QUOTE |
Нету. Как создать |
CODE |
groupadd ftp - добавляем группу useradd ftp -s /sbin/nologin -d /dev/null -g ftp - добавляем юзера |
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> |
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> |
QUOTE |
создаешь ему пароль |
QUOTE |
AuthUserFile/etc/proftpd/passwd.ftp |
QUOTE |
Или я его сам наваял? |
QUOTE |
make_pass_ftp.pl |
QUOTE |
А что в нем одна функция? |
QUOTE |
Он только для этого и предназначен... для хеширования пароля |
QUOTE |
У меня нет такого файла |
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"; |
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 |
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 |
QUOTE |
Что это? Конфиг у тебя совсем не такой |
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> |
QUOTE |
У Дюка конфа для vsftpd |
QUOTE |
Port 2021 |
QUOTE |
У тебя что валяеццо в etc директории proftpd? |
QUOTE |
Ещё не решена |
QUOTE |
а в чём сейчас загвоздка ? |
QUOTE |
Кстать,а может vsftpd поставить ? |
QUOTE |
Если не получится с этим придется |
QUOTE |
а хотяб ананимно заходит ? |
QUOTE |
пишет 500 OOPS: could not bind listening IPv4 socket |
QUOTE |
и даже ананимно пускает |
QUOTE |
db_load -T -t hash -f logins.txt /etc/vsftpd_login.db |
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' |
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> |
QUOTE |
db_load -T -t hash -f logins.txt /etc/vsftpd_login.db |
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> |
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 |
CODE |
root bin daemon adm lp sync shutdown halt news uucp operator games nobody |
CODE |
root bin daemon adm lp sync shutdown halt news uucp operator games nobody |
QUOTE |
db_load |
QUOTE |
килль нафиг.. |
QUOTE |
Но теперь я знаю куда копать |
QUOTE |
А если ты 2 ftp поставил, теперь кого то придеццо глушить |
QUOTE |
Убей папку с конфами, выкинь из скриптов запуска, и из bin и sbin папок. |
QUOTE |
на каком сервере остановился всётки ? |
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 |
CODE |
passwd gratis |
CODE |
# Users that are not allowed to login via ftp root bin daemon adm lp sync shutdown halt news uucp operator games nobody |
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 news uucp operator games nobody |
CODE |
500 OOPS: could not bind listening IPv4 socket Подключение к узлу утеряно. |
QUOTE |
Вот теперь всё работает |
QUOTE |
что всё ? |
QUOTE |
Как ты сказал не получается |
QUOTE |
Так как ты описал не создаются |
QUOTE |
а файла db_load у меня нет |
QUOTE |
должны создаваться ! это стандартные коммнды для Линуха! в каком месте затык ? может создаёш юзера который уже есть в системе ? |
QUOTE |
Зачем мне юзеры в линуксе? Я юзеров должен создать в vsftpd |
QUOTE |
и все юзеры которые есть в proftpd видят всё содержимое если не задал ограничения в конфигурации фтп сервера. |
CODE |
chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list |
QUOTE |
А как зайти под рутом? |
QUOTE |
это глупая идея |
QUOTE |
vsftpd умеет авторизовать только пользователей Linux, пока еще разработчики не связали vsftpd с каким-нить SQL'ем... Поэтому никаких специальных хэш-файлов с паролями для vsftpd-сервиса создавать не надо, используются стандартные /etc/passwd и /etc/shadow. |