PDA

View Full Version : ftp server


hirohitosan
December 21st, 2008, 10:22
I have problems with my ftp server.

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

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

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

and # 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 $ 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
December 21st, 2008, 11:23
# pkg_info pure-ftpd
pkg_info: can't find package 'pure-ftpd' installed or in a file!


Try this: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 (http://download.pureftpd.org/pub/pure-ftpd/doc/README.Configuration-File) 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...

hirohitosan
December 21st, 2008, 11:30
I think you have something misconfigured there.

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

and 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
December 21st, 2008, 11:38
sudo pkg_delete pure-ftpd-1.0.21_2
Or as root, without the sudo part.

dclau
December 21st, 2008, 11:52
I attached a sample of (untouched) configuration file. It is very well commented, i hope it'll help.

danger@
December 22nd, 2008, 01:18
the configuration file should be located in /usr/local/etc/

dclau
December 22nd, 2008, 03:01
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
December 22nd, 2008, 05:36
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.

hirohitosan
December 22nd, 2008, 13:00
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
December 22nd, 2008, 13:50
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.

hirohitosan
December 22nd, 2008, 15:01
here what I have in /usr/local/etc/rc.d:
# 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:
# /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

edogawaconan
December 28th, 2008, 16:51
what's in your /usr/local/etc/pure-ftpd.conf ?

hirohitosan
January 9th, 2009, 17:53
what's in your /usr/local/etc/pure-ftpd.conf ?
I put in attachment the pure-ftpd.conf file

trev
January 10th, 2009, 13:28
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:

#!/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"