ftp server

hirohitosan

Well-Known Member

Reaction score: 3
Messages: 279

I have problems with my ftp server.

I installed pure-ftpd server but maybe something went wrong since I cannot connect through ftp.

Code:
Connected to my.ftp.server.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 09:12. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
331 User user OK. Password required
Password:
530 Login authentication failed
ftp: Login failed.
ftp> 


and I'm sure I gave the right psw

Code:
# pkg_info pure-ftpd
pkg_info: can't find package 'pure-ftpd' installed or in a file!

and
Code:
# ps ax
.
.
.
21286  ??  Is     0:00.02 pure-ftpd (SERVER) (pure-ftpd)


how can I fix this problem? where is the problem?

PS
I also try
Code:
$ ftp localhost
Connected to localhost.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 09:25. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (localhost:user): user
331 User horatiu OK. Password required
Password:
530 Login authentication failed
ftp: Login failed.


thanks
 

dclau

Member

Reaction score: 23
Messages: 64

hirohitosan said:
Code:
# pkg_info pure-ftpd
pkg_info: can't find package 'pure-ftpd' installed or in a file!
Try this:
Code:
pkg_info | grep pure

Also double-check the config file (if you use one) or the command used when you start your ftp server. I think you have something misconfigured there.

The README says:
Unlike many daemons, Pure-FTPd doesn't read any configuration file (but for
LDAP and SQL). Instead, it uses command-line options.
...
If you want to use a configuration file with Pure-FTPd, you can, through
a wrapper. That wrapper will parse a file and convert it to command-line
options. Then, the server will be started with these options.

Please have a look at the 'configuration-files' directory. Copy the sample
configuration file called 'pure-ftpd.conf' to a suitable location, say /etc...
 
OP
hirohitosan

hirohitosan

Well-Known Member

Reaction score: 3
Messages: 279

dclau said:
I think you have something misconfigured there.

Me too but I don't find any configuration file. Don't know where to search.

and
Code:
pkg_info | grep pure
pure-ftpd-1.0.21_2  A small, easy to set up, fast and very secure FTP server


at least how can I deinstall and install again?
 

dclau

Member

Reaction score: 23
Messages: 64

Code:
sudo pkg_delete pure-ftpd-1.0.21_2

Or as root, without the sudo part.
 

dclau

Member

Reaction score: 23
Messages: 64

I attached a sample of (untouched) configuration file. It is very well commented, i hope it'll help.
 

Attachments

  • pure-ftpd.conf.tar
    12.5 KB · Views: 123

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 369
Messages: 996

the configuration file should be located in /usr/local/etc/
 

dclau

Member

Reaction score: 23
Messages: 64

danger@ said:
the configuration file should be located in /usr/local/etc/

If you run pure-config.pl /path/to/your/config it doesn't really matter where you put the configuration file, i guess, but you're right, when installed from ports the config file goes there.
 

SaveTheRbtz

Member

Reaction score: 9
Messages: 83

I can be wrong but pure-ftpd can refuse login if something wrong with ftp folder ( does not exists / wrong permitions )
for more information check pure-ftpd's log

PS. From the beginning all pure-ftpd's setting passed as command line parameters, and all so-called config files are just merely hacks / parsers.
 
OP
hirohitosan

hirohitosan

Well-Known Member

Reaction score: 3
Messages: 279

Thanks guys!
I deinstall pure-ftpd and install it again.

How can I automatically run the server when the system boots?

In pure-ftpd documentation says:
add the command

/usr/local/sbin/pure-ftpd &

to /etc/rc.d/rc.local or /etc/rc.d/boot.local . Don't forget the '&' sign.
but I don't have /etc/rc.d/rc.local or /etc/rc.d/boot.local

thanks
 

tingo

Daemon

Reaction score: 549
Messages: 2,403

hirohitosan said:
How can I automatically run the server when the system boots?

Most (ok, many) FreeBSD ports use a variable in /etc/rc.conf file of the form portname_enable="YES" to enable the port. Coupled with a startup script in /usr/local/etc/rc.d, the port will be started when FreeBSD starts up.
For pureftpd, I believe the needed entry in /etc/rc.conf is:
pureftpd_enable="YES"

Hope this helps.
Oh, one more thing: you can usually run
/usr/local/etc/rc.d/scriptname rcvar
to find out which variables a script supports.
 
OP
hirohitosan

hirohitosan

Well-Known Member

Reaction score: 3
Messages: 279

here what I have in /usr/local/etc/rc.d:
Code:
# ls /usr/local/etc/rc.d
020named.sh             courier-imap-imapd-ssl  postgresql
040exim.sh              courier-imap-pop3d      proftpd
050proftpd.sh           courier-imap-pop3d-ssl  pure-authd.sh
080cpanel4.sh           dovecot                 pure-ftpd
090chkservd.sh          exim                    rsyncd
apache22                htcacheclean            stunnel
chkservd.sh             httpd                   webmin

I did:
Code:
# /usr/local/etc/rc.d/pure-ftpd rcvar
# pureftpd
$pureftpd_enable=YES


and I add in
/etc/rc.conf

pureftpd_enable="YES"

but after rebooting the server still not start
 
OP
hirohitosan

hirohitosan

Well-Known Member

Reaction score: 3
Messages: 279

edogawaconan said:
what's in your /usr/local/etc/pure-ftpd.conf ?
I put in attachment the pure-ftpd.conf file
 

Attachments

  • pure-ftpd_conf.txt
    11.2 KB · Views: 251

trev

Aspiring Daemon

Reaction score: 242
Messages: 956

The /etc/rc.conf edit you made has no effect unless you've also written, or otherwise have, an extended application startup script in /usr/local/etc/rc.d/ similar to:

Code:
#!/bin/sh

# PROVIDE: pureftpd
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable pure-ftpd:
#
# pureftpd_enable="YES"
#
# For launch uploadscript daemon define
# pureftpd_upload_enable="YES"
# pureftpd_uploadscript="/full/path/to/launch_script"
#

. /etc/rc.subr

name=pureftpd
rcvar=`set_rcvar`

load_rc_config $name

command=/usr/local/sbin/pure-config.pl
command_upload=/usr/local/sbin/pure-uploadscript
pureftpd_uploadscript=${pureftpd_uploadscript:-"/usr/bin/touch"}
pureftpd_config=${pureftpd_config:-"/usr/local/etc/pure-ftpd.conf"}
required_files=${pureftpd_config}
pidfile=/var/run/pure-ftpd.pid
pidfile2=/var/run/pure-uploadscript.pid
procname=pure-ftpd

pureftpd_enable=${pureftpd_enable:-"NO"}
command_args=${pureftpd_config}
command_upload_args="-B -r ${pureftpd_uploadscript}"

start_postcmd=start_postcmd
stop_postcmd=stop_postcmd

start_postcmd()
{
       if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
       echo "Starting ${command_upload}."
       ${command_upload} ${command_upload_args}  
       fi
}

stop_postcmd()
{
        if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
        pid=$(check_pidfile ${pidfile2} ${command_upload})
        if [ -z ${pid} ]; then
        echo "Upload script not running? (check ${pidfile2})."
        return 1
        fi
        echo "Stopping ${command_upload}."
        kill -${sig_stop:-TERM} ${pid}
        [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
        wait_for_pids ${pid}
        fi
}

run_rc_command "$1"
 
Top