# Pureftp 500 Unknown Command

## bigdave1

Hi

I have setup pureftp to run under xinetd. The problem I'm having is when I try to login, I'm getting "500 Unknown Command". Here is what my /etc/xinetd.conf file looks like:

service ftp

    {

       # flags           = REUSE

       socket_type     = stream

       # instances       = 50

       wait            = no

       user            = root

       server          = /usr/sbin/pure-ftpd

       server_args     = -4 -c 10 -N -p 1400:1500 -S bigdave.homelinux.net,

       protocol        = tcp

       bind            = 192.168.1.10

       log_on_success  = HOST PID

       log_on_failure  = HOST RECORD

       disable = no

    }

Here's what I get in my /var/log/messages:

linuxsvr etc # tail /var/log/messages

Jun 10 06:28:29 linuxsvr pure-ftpd: (ftp@192.168.1.1) [INFO] Timeout (no new data for 900 seconds)

Jun 10 01:29:27 linuxsvr xinetd[13707]: START: ftp pid=13726 from=192.168.1.10

Jun 10 01:29:27 linuxsvr pure-ftpd: (?@bigdave.homelinux.net) [INFO] New connection from bigdave.homelinux.net

Jun 10 01:29:27 linuxsvr pure-ftpd: (?@bigdave.homelinux.net) [INFO] Anonymous user logged in

Jun 10 01:30:01 linuxsvr cron[13729]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Jun 10 06:30:36 linuxsvr pure-ftpd: (ftp@192.168.1.1) [INFO] Timeout (no new data for 900 seconds)

Jun 10 06:30:53 linuxsvr pure-ftpd: (ftp@bigdave.homelinux.net) [INFO] Logout.

Jun 10 01:30:56 linuxsvr xinetd[13707]: START: ftp pid=13741 from=192.168.1.10

Jun 10 01:30:56 linuxsvr pure-ftpd: (?@bigdave.homelinux.net) [INFO] New connection from bigdave.homelinux.net

Jun 10 01:30:56 linuxsvr pure-ftpd: (?@bigdave.homelinux.net) [INFO] Anonymous user logged in

I have a user called ftp and have its home directory set so I can have anonymous logins. Any ideas as to whats going on?

----------

## bigdave1

UPDATE:

I've changed my /etc/xinetd.conf file to look like this:

service ftp

    {

       # flags           = REUSE

       socket_type     = stream

       # instances       = 50

       wait            = no

       user            = root

       server          = /usr/sbin/pure-ftpd

       server_args     = -a 42 -c 1024 -p 1400:1500

       protocol        = tcp

       bind            = 192.168.1.10

       log_on_success  = HOST PID

       log_on_failure  = HOST RECORD

       disable = no

    }

I no longer get the "500 Unknown Command" error, but I cannot login from another computer plugged into my Linksys router running Internet Explorer or Netscape. I'm completely lost. Please help!

----------

## bigdave1

Ok, I need people to be able to connect using IE and Netscape. I've tried using the -N option and that gives me the "500 Unknown Command". I also need people from the outside world to be able to ftp in, and that is not happening either. I have forwarded ports 20 and 21 in my router. My router is a Linksys BEFSR41. I'm at the end of my rope here, so I'm hoping that someone can help me with this issue. If I can just get this finished, I will be done with what I have set out to do. Please help out this old man!  :Smile: 

----------

## UberLord

I'm going to assume that the -p  option is for PASV ports (which any good ftp server needs).

So you need to forward ports 1400 - 1500 from your router to your ftp server

----------

## bigdave1

Well, I've figured out a big part of my problem. I had to set the IP of my linux box as the DMZ in my router. I can now access it from my other computer. However, if I try to ftp in using firefox, I still get 500 Unknown Command. I know its something funky with the switches. The -N switch doesn't do anything for me.

And I do have ports 1400 - 1500 open in my router.

----------

## bigdave1

Ok, I've had to pretty much redo everything to actually get it to work like it should. I've switched it from using xinetd to as a standalone server. Everything works great, I can access it from 2 other computers on my network and it can be accessed from the outside world. However, I am unable to access it from the actual server. When I try to access it using Firefox or Konqueror on the server, I get a timeout.

Here's my /etc/init.d/pure-ftpd file:

# Config file for /etc/init.d/pure-ftpd

##Comment variables out to disable its features, or change the values in it... ##

## This variable must be uncommented in order for the server to start ##

IS_CONFIGURED="yes"

## FTP Server,Port (separated by comma) ##

## If you prefer host names over IP addresses, it's your choice :

## SERVER="-S ftp.rtchat.com,21"

## IPv6 addresses are supported.

## !!! WARNING !!!

## Using an invalid IP will result in server not starting and reporting

## a good start. Work is being done to solve that in:

## https://bugs.gentoo.org/show_bug.cgi?id=75861

#SERVER="-S 192.168.0.1,21"

SERVER="-S 21"

## Number of simultaneous connections in total, and per ip ##

MAX_CONN="-c 30"

MAX_CONN_IP="-C 10"

## Start daemonized in background ##

DAEMON="-B"

## Don't allow uploads if the partition is more full then this var ##

DISK_FULL="-k 90%"

## If your FTP server is behind a NAT box, uncomment this ##

# USE_NAT="-N"

## Authentication (others are 'pam', ...)##

## Further infos in the README file.

AUTH="-l unix"

## Change the maximum idle time. (in minutes. default 15)

#TIMEOUT="-I <timeout>'"

## Use that facility for syslog logging. It defaults to 'ftp'

## Logging can be disabled with '-f none' .

#LOG="-f facility"

## Misc. Others ##

MISC_OTHER="-b -p 1400:1500 -P xx.xx.xx.xx"   # IP taken out for security purposes, but its my public IP

#

# Use these inside $MISC_OTHER

# More can be found on "http://pureftpd.sourceforge.net/README"

#

# -A [ chroot() everyone, but root ]

# -e [ Only allow anonymous users ]

# -E [ Only allow authenticated users. Anonymous logins are prohibited. ]

# -i [ Disallow upload for anonymous users, whatever directory perms are ]

# -j [ If the home directory of a user doesn't exist, auto-create it ]

# -M [ Allow anonymous users to create directories. ]

# -R [ Disallow users (even non-anonymous ones) usage of the CHMOD command ]

# -x [ Authenticated users can read/write files beginning with a dot ('.') 

#       Anonymous users can't, for security reasons ]

# -X [ Users can't write/read files and directories starting with a dot ('.') ]

# -D [ List files beginning with a dot ('.') even when the client doesn't

#      append the '-a' option to the list command. A workaround for badly

#      configured FTP clients. ]

# -G [ Disallow renaming. ]

# -d [ Send various debugging messages to the syslog. ONLY for DEBUG ]

# -F <fortune file> [ Display a fortune cookie on login. Check the README file ]

# -H [ By default, fully-qualified host names are logged. The '-H' flag avoids host names resolution. ]

Any ideas on what I'm doing wrong?

Thanks!

----------

