LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 10-28-2004, 09:17 PM   #1
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Rep: Reputation: 30
FTP search dir "ls" error


I had a problem when test the FTP server, after login, there comes out this error when I was trying to search the dir "ls". I tried this in the windows XP command prompt.

It does works well with some of my friend PC and also occurs the belowing error. This error also happens locally FTP client with using command prompt and WS_FTP

230 Login successful.
ftp> ls
500 Illegal PORT command.
425 Use PORT or PASV first.

Can i know why this happen? a Anyone knows please help....

Thank You
 
Old 10-29-2004, 03:19 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Looks like a active ftp vs passive ftp problem.

Don't know if it's possible with the client you are using, but try setting passive mode for this url and try again. You can also do this from within an ftp session (ftp> passive).

If you have access to the ftp server, try looking for a setting in the conf file that deals with active/passive ftp.

Hope this helps.
 
Old 10-29-2004, 03:45 AM   #3
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
I had tried using the passive mode but the error are the same....

Code:
ftp> passive
Passive mode off.
ftp> ls
500 Illegal PORT command.
ftp: bind: Address already in use
I also already change the vsftpd.conf to

pasv_enable=YES

Can i know what is going on please ? Thanks...
 
Old 10-29-2004, 06:04 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
I just noticed all the other threads you started about ftp (and the problems that came with it).

Are all those previous issues solved and is your box set up the way it's supposed to be set up?

BTW: Is vsftpd listening on the normal ftp ports or did you change that in any way?
 
Old 10-29-2004, 07:27 AM   #5
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
All the problems is solve and now this is the only problem left.


I hope this last problem can be solve also
 
Old 10-29-2004, 12:09 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Let's give this another try. Just a few questions to get a better view of the problem:

Are you running a proxy server on your box?

Is vsftpd listening on the normal ftp ports or did you change that in any way?

Does the problem arise when using plain old ftp (locally)?

Could/would you post your vsftpd.conf.
 
Old 10-29-2004, 12:16 PM   #7
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
- How do i know i am running proxy server? I dont know about proxy server.......
- I think my vsftpd is listening to the normal port......
- The proble occurs also when i tr locally using old ftp and also WS_FTP

Thanks fot the help, below is the vsftpd.conf file

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=NO
#
# 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.
dirmessage_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),
# 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 TYJ's FTP
#
# 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
                                                                                                                                                                                                                                                         
pasv_enable=YES
                                                                                                                             
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
 
Old 10-29-2004, 12:57 PM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Ok, let's see if something strange turns up.......

There are enough option you could play with, but my first guess would be the listen option.

By default this option is set to no (you have it turned on [yes]). If I remember correctly, vsftpd likes to take care of things itself. If you disable this some other mechanism will have to take care of these tasks.

Try setting this option to no.

And do you have tcp_wrapper support compiled in? If not, change tcp_wrappers=YES to no.
If you don't know the answer to the above question: Is this the conf file that came with vsftpd or did you edit it yourself (and why)?

BTW: Savest procedure of changing settings and making sure they are activated and 'old stuff' is removed:

First shut down the ftp server, than change the setting(s) you want and start the ftp server again.

Quote:
- How do i know i am running proxy server? I dont know about proxy server.......
If you installed your linux box and don't know about proxies: You are probably (99% sure) not running one.


If the 'advise' I gave at the beginning of this post did not help:


Quote:
- I think my vsftpd is listening to the normal port......
Could you do me a favor and start an ftp session (just log in, that's it) and post the output of the following command (run the commands on the ftp server):

$ lsof -i | grep ftp

If lsof isn't installed:

$ netstat -a | grep ftp

And after logging out of the ftp session, also post the last 20 lines from your vsftpd log (/var/log/vsftpd.log)


Hope this helps............

Last edited by druuna; 10-29-2004 at 12:58 PM.
 
Old 10-30-2004, 05:16 AM   #9
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
If i set the below, the error shows. Connection closed by remote host
Listen = No
I dont know bout i had tcp_wrapper support compiled or not......... but i do edit the vsftpd.conf file previously

This is the only file i had inside the /etc/vsftpd/
-rwxr-xr-x 1 root root 4165 Oct 30 18:00 vsftpd.conf

Everytime after i make changes of the vsftpd.conf file i will restart the service
Code:
[root@localhost eugene]# /etc/init.d/vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
Code:
[root@localhost vsftpd]# lsof -l | grep ftp
bash: lsof: command not found
Code:
[root@localhost vsftpd]# netstat -a | grep ftp
tcp        0      0 *:ftp                   *:*                     LISTEN

The below are the /var/log/vsftpd.log file
Code:
Mon Oct 25 00:34:10 2004 136 218.111.150.246 4527784 /var/ftp/pub/Michael Bolton/Hercules Soundtrack - I can go the distance.mp3 a _ o r yujin ftp 0 * c
Wed Oct 27 22:20:27 2004 214 219.95.18.205 6825662 /var/ftp/pub/98 Degrees/123.mp3 a _ o r yujin ftp 0 * c
Wed Oct 27 22:27:49 2004 125 219.95.18.205 3951096 /var/ftp/pub/98 Degrees/98 Degrees - This Gift.mp3 a _ o r yujin ftp 0 * c
I cant login with my FTP server computer with no result
[root@localhost vsftpd]# ftp tyj.homeftp.org

But with localhost is fine
Code:
[root@localhost vsftpd]# ftp tyj.homeftp.org
[root@localhost vsftpd]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TYJ's FTP
Name (localhost:eugene): yujin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,171,203)
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Oct 27 14:16 98 Degrees
drwxr-xr-x    2 0        0            4096 Oct 15 17:37 Boyz II Men
drwxr-xr-x    2 0        0            4096 Oct 15 17:37 Michael Bolton
226 Directory send OK.
Can you please try it for me and see whats going on? Thanks for the help.........
 
Old 10-30-2004, 06:07 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

Maybe you misunderstood some of the pointers I gave in my previous post, or you did try them but forgot to tell

1) Did you try to change tcp_wrappers=YES to NO? (whith and without the listen=no/yes option).
2) Why did you change some of the entries in the original vsftpd.conf file.


Ok, about the info you gave:

Code:
[root@localhost vsftpd]# netstat -a | grep ftp
tcp        0      0 *:ftp                   *:*                     LISTEN
Although it's not entirely what I asked for, this part seems correct.
What I would like to see is the above command while somebody is logged in by ftp. I prever an outside connection, but because that migth not be possible, a local ftp session would do.


The output from the vsftpd.log file cannot be correct........
There are only three entries there, all of them 'old', and no stop/start messages. I assume that the sample ftp session you posted was done today (oct 30), this entry isn't there.
All entries that are present are not from your IP but from an outside IP address, it also seems that everything worked ok for these downloads. Am I correct in that?

Also, this I don't understand:

[root@localhost vsftpd]# ftp tyj.homeftp.org
[root@localhost vsftpd]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TYJ's FTP
.
.

It's about the bold line. You don't get any (error) message after entering that line????


Finaly here's a general sample config, which you could try. Only thing I'm not sure about is the nopriv_user entry:
Code:
anonymous_enable=NO
local_enable=YES
dirmessage_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd/vsftpd.log
nopriv_user=nobody
chroot_list_enable=YES
chroot_local_user=YES
background=YES
listen=YES

BTW: I'm not able to login to your ftp site, I don't have an account on your machine
This is what I get, which seems correct up to this point:

$ ftp tyj.homeftp.org
Connected to tyj.homeftp.org.
220 Welcome to TYJ's FTP
Name (tyj.homeftp.org:druuna):


I does prove that you are reachable from the outside and that vsftpd gives me the possibility to log in.

That's enough info/questions for the moment, let's see what comes up next.
 
Old 10-31-2004, 01:31 AM   #11
dwarf007
Member
 
Registered: Sep 2004
Location: Malaysia
Posts: 181

Original Poster
Rep: Reputation: 30
This seems a bit long to read, i hope you will get what i mean from the info below.....
1) i had tried tcp_wrappers=NO , the results are the same , when type ls for checking the dir, the errr will be
Code:
ftp> ls
500 Illegal PORT command.
ftp: bind: Address already in use
2) This is because i saw from article the original vsftpd.conf need to change values
listen=YES, if by default will be set to NO, ant the connection cant even succesfull

The below 192.18.1.185 is my local NIC address
Code:
[root@localhost root]# netstat -a | grep ftp
tcp        0      0 *:ftp                   *:*                     LISTEN
tcp        0      0 192.168.1.185:ftp       219.95.168.127:32790    TIME_WAIT
The conenction from the client to the FTP server doesnt show in here? Buit the conenction does successful, only
the below error ater change passive mode off

500 Illegal PORT command.
ftp: bind: Address already in use

Before passive mode off
Code:
227 Entering Passive Mode (192,168,1,185,107,244)
ftp: connect: No route to host
I found that i had few vsftpd.log file and all are with different info inside
vsftpd.log.1 - vsftpd.log.4

The below is the vsftpd.log.3
Code:
Tue Oct 12 13:42:13 2004 1 192.168.1.185 5077786 /usr/ftp/pub/Richard Marx/Richard Marx - Hazard.mp3 b _ o r testing ftp 0 * c
Wed Oct 13 20:56:10 2004 1 127.0.0.1 2445816 /usr/ftp/pub/98 Degrees/98 Degrees - Give Me Just One Night.mp3 b _ o r drfetish ftp 0 * c
Wed Oct 13 20:59:40 2004 1 192.168.1.185 4538626 /usr/ftp/pub/98 Degrees/98 Degrees - Invisible Man.mp3 b _ o r drfetish ftp 0 * c
Wed Oct 13 21:07:36 2004 1 192.168.1.185 3951096 /usr/ftp/pub/98 Degrees/98 Degrees - This Gift.mp3 b _ o r drfetish ftp 0 * c
Thu Oct 14 13:48:38 2004 1 127.0.0.1 5276022 /usr/ftp/pub/Boyz II Men/Boyz II Men - On Bended Knees.mp3 b _ o r drfetish ftp 0 * c
Thu Oct 14 13:49:36 2004 1 127.0.0.1 4538626 /usr/ftp/pub/98 Degrees/98 Degrees - Invisible Man.mp3 b _ o r drfetish ftp 0 * c
Thu Oct 14 13:52:00 2004 1 127.0.0.1 3951096 /usr/ftp/pub/98 Degrees/98 Degrees - This Gift.mp3 b _ o r drfetish ftp 0 * c
Sat Oct 16 01:46:57 2004 1 192.168.1.185 4538626 /var/ftp/pub/98 Degrees/98 Degrees - Invisible Man.mp3 b _ o r yujin ftp 0 * c
Sat Oct 16 01:52:07 2004 1 192.168.1.185 5600781 /var/ftp/pub/Boyz II Men/Boyz II Men - End of the road.mp3 b _ o r yujin ftp 0 * c
Sat Oct 16 01:53:06 2004 1 192.168.1.185 3995648 /var/ftp/pub/Michael Bolton/Michael Bolton - To Love Somebody.mp3 b _ o r yujin ftp 0 * c
The below is the vsftpd.log.4
Code:
Sat Oct  9 22:42:53 2004 1 127.0.0.1 3434241 /usr/ftp/pub/Richard Marx/Richard Marx - Now and Forever.mp3 b _ o r testing ftp 0 * c
Quote:
All entries that are present are not from your IP but from an outside IP address, it also seems that everything worked ok for these downloads. Am I correct in that?
Does everytime a client login to my FTP server and download file, there will be a new vsftpd.log file generate and state what the donwlaod and they do within the FTP server?

I had two of my friend able to login and access my FTP, both of them also able to download files from me. But there is another friend not able and my local client PC as well

Quote:
Also, this I don't understand:
[root@localhost vsftpd]# ftp tyj.homeftp.org
[root@localhost vsftpd]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TYJ's FTP
.
It's about the bold line. You don't get any (error) message after entering that line????
There is no error when i use the domain, i registered from www.dyndns.org and also using client to update the Internet IP because mine is dynamic DNS, all this are fine

These things is not set inside the vsftpd.conf
Code:
nopriv_user=nobody
chroot_list_enable=YES
chroot_local_user=YES
Should i put into it? Are these important?

Thanks for the help....... I hope the problem about 500 Illegal PORT command will be able to slove soon.....
Anyone who knows please hekp, thank you....
 
Old 10-31-2004, 05:12 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
It looks like you are going in circles and the sollution to this problem is not obvious.

You might want to consider starting from scratch and set up vsftpd the way the vsftpd site suggests.

There are some examples that could help.
This one using vsftpd together with xinetd: ftp://vsftpd.beasts.org/users/cevans...INTERNET_SITE/

This without xinetd: ftp://vsftpd.beasts.org/users/cevans..._SITE_NOINETD/

Try to get it working without changing anything in the above sample vsftpd.conf. Only exception being the no_access = 192.168.1.3 option when using the xinetd version (remove it for now). Once it's up and running you can beautify/fine tune the configuration.

The routing of your box (one of your earlier problems) could still be the problem that causes this ftp problem. The 2 errors that seem to keep popping up are:
- 500 Illegal PORT command. ftp: bind: Address already in use
- ftp: connect: No route to host

Last edited by druuna; 10-31-2004 at 05:13 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
C -communicating with system("ftp"); using "program|ftp>>myfifo" probably hansschmucker Programming 1 03-23-2005 01:39 PM
"configure: error: can not find sources in <dir>" naveenkoneru Linux - Software 0 05-31-2004 05:08 PM
Python compilation error, "module search path"etc.. mindfestival Linux - Newbie 0 05-31-2004 02:52 AM
FTP Error, Help needed. "Must perform authentication before identifying USER" acalvin Linux - Software 0 07-27-2003 01:41 PM


All times are GMT -5. The time now is 08:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration