Link to home
Create AccountLog in
Linux

Linux

--

Questions

--

Followers

Top Experts

Avatar of bwask
bwask🇺🇸

Squid 3.1.1 proxy server will not FTP
Hello All,

I have 4 servers running squid/3.1.1 proxy server. Since the latest version I can no longer FTP. I have posted this problem in multiple places but have received almost no response. I've found several other post to this problem throughout the Internet which have also gone unanswered. So, once again I thought I'd give it a try.

As I said "I have 4 servers running the newest version of Squid". When I try to access an ftp, any ftp, I receive an error (check attached image). This was never a problem until just recently. Squid should work perfectly fine with ftp, it is not a strictly http proxy.

I turned my firewall off just to make sure, still had the same issue. If I jump directly on the server itself with no proxy settings set in the browser it will work fine. As soon as I set the browser setting to access the Squid software I get the same error.

I've included my squid config (which is unchanged from the default settings), maybe somebody better versed than myself can point out an obvious flaw. Everything else seems to work just fine, it's only FTP that's a problem.

Thanks for any help
Eric
squid-311-config.txt
Squid-ftp-error.JPG

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of bwaskbwask🇺🇸

ASKER

Also, if I go look at the /var/log/squid/access.log file I see the following message:

1273527600.117     51 172.17.137.11 TCP_REFRESH_UNMODIFIED/304 382 GET http://www.squid-cache.org/Artwork/SN.png - DIRECT/209.169.10.131 -

Avatar of arnoldarnold🇺🇸

Other than the ACL that allows port 21 you do not include the settings for FTP.
http://www.squid-cache.org/Versions/v3/3.1/cfgman/

Your error deals with what the proxy server retrieved from itself to render the error message you are displaying.

Could you look at what your squid proxy does for the request ftp://ftp.

check to make sure you do not have an EXE restriction.
See if you can access the directory listing where the application you wish to download resides.


Avatar of bwaskbwask🇺🇸

ASKER

ftp://ftp... both Firefox and IE8 say they can not find the page, but I don't get the a Squid error. There is no .exe restriction. As I said this is an out of the box config. I have tried my personal ftp as well and it gives the same error, regardless if I point it at a folder or a file.

All works fine if the proxy is turned off.

I'm not sure what you talking about in your first paragraph.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of arnoldarnold🇺🇸

Double check whether your proxy configuration on the systems or within the application direct the application IE or Firefox to use the proxy for the FTP protocol.

Often you have to either specify that the proxy is to be used for all protocols http, ftp, https, etc. or it only applies to HTTP type of connections.

Could you check your squid log to see whethe it is actually getting a request for ftp?
try the ftp connection in the following form:
ftp://ftp.host.com:21/ to see if it will make a difference provided the configuration of the local proxy setup reflects that all connection or at least http and ftp should go through the proxy server?

Avatar of bwaskbwask🇺🇸

ASKER

Yes, my browsers are pointing at the proxy for ftp access, if they weren't, I wouldn't get the Squid error.

Specifying port 21 has the same result.

1273604907.384    382 172.17.137.105 TCP_MISS/502 4089 GET ftp://ftp.fedex.com/pub/us/software/FedExShipManager_2453.exe:21 - DIRECT/199.81.203.40 text/html

I'm getting the same line as I posted above in access.log when I try to access a ftp site. There is no doubt that the machines are talking to Squid. Squid just keeps rejecting ftp requests for some reason.


Avatar of arnoldarnold🇺🇸

The port is specified at the end of the host and not at the end as you have:
ftp://ftp.fedex.com:21/pub/us/software/FedExShipManager_2453.exe

You need to check and possible set the several ftp related option i.e. to use the telnet protocol or not to use it.
To make sure that passive FTP is on.
do you have tcpdump or another network utility that you could use to see what is going on on the proxy?  i.e. does its outgoing FTP connection suceeds? i.e. telnet ftp.fedex.com 21.
Can you from the proxy ftp out using ftp, ncftp or anyother ftp program that you may have available?

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of bwaskbwask🇺🇸

ASKER

Sorry about that, I copied and pasted the wrong line. Yes I put the :21 in the correct place, no joy.

I forced my ftp as well, if what you mean is not selecting "use this proxy server for all protocols" and then manually imputing the proxy server. Again, no joy.

As far as through an FTP client. It seems to work through FireFTP (Firefox addon) OK, I can see it talking through the proxy in the access.log file.


Avatar of arnoldarnold🇺🇸

Now the issue is when you are using a browser IE or Firefox, is there a difference in behavior based on the entries in the access log?

Avatar of bwaskbwask🇺🇸

ASKER

Not positive about that yet. I've tried about 4 different ftp utilities to try and get one that I know is using the proxy correctly. I'm not exactly sure what Fireftp is doing. So far I'm not having a lot of luck finding one that will.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of bwaskbwask🇺🇸

ASKER

Ok ended up using TurboFTP,

Here is what it says in Squid's log file:

1273669060.572     13 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669070.850      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669080.869      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669090.872      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669100.875      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669110.878      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html
1273669120.881      0 172.17.137.105 TCP_DENIED/403 3293 CONNECT hostname.com:21 - NONE/- text/html

I have access to the server that I'm trying to connect to and it Squid doesn't even appear to be talking to it. Works fine if I remove the proxy settings.

Avatar of bwaskbwask🇺🇸

ASKER

Is there a way to get squid to give me a little more info in the log file?

Avatar of arnoldarnold🇺🇸

You need to add a rule to add CONNECT to 21.
I.e. add
acl SSL_PORTS port 21.
reload the config and you should be good to go.

Currently the CONNECT method is restricted to the SSL_PORTS only.

This might be because the FTP server is not working according to the FTP standards.
you could try setting the ftp_telnet_protocol to off and see if that also makes a difference.

You should have a sample squid.conf.default as an example that includes descriptions and application of the various options.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of bwaskbwask🇺🇸

ASKER

Added and restarted squid. Same issue.

Avatar of arnoldarnold🇺🇸

Which options did you add?
Try the following (lines starting with a # are a comment or provide information. Entries surrounded by less than and greater signs <> are variables that need to be replaced
telnet <your_proxy_server> <your proxy port>
#upon connecting to your proxy type in:
CONNECT <ftp.hostname.com>:21 HTTP/1.0
#after hitting the enter key you should either get a warning that the connection can not be established or a connection to the remote server is established (and you get a 220) and the server is ready for authentication. using user anonymous and pass <your_email_address>
#after a successful authentication typing in
PASV
#will set the ftp server to PASV mode which means it will output the information through which the FTP client will calculate the data port to which it needs to connect on the server.  This might be the problem.  You need to add a range >1024 to the SSL_ports as well.
#This test will confirm whether your proxy can handle the connection to the remote FTP server.

Forgot about the data stream component of the FTP.

Avatar of arnoldarnold🇺🇸

Another option to try is from http://nixcraft.com/linux-software/384-ftp-through-squid.html
use an ACL to allow FTP.
http://www.labtestproject.com/linux_network/step_by_step_enable_ftp_on_squid_proxy_in_linux_fedora_10.html
acl FTP proto FTP
always_direct allow FTP
Adding a range of IPs will solve the issue, but will let any user behind your proxy who knows to use the connect method to bypass any/all restrictions you may have.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of bwaskbwask🇺🇸

ASKER

I disabled SeLinux on a hunch.

I can now get to sites like this:
ftp://ftp.samurai.com/pub/squid/archive/3.1/

but can not get to this site:
ftp://ftp.fedex.com/pub/us/software/FedExShipManager_2453.exe

or my own ftp (vsftpd) for that matter.

It would appear that I have multiple problems. Oviously Squid is till blocking something, and SeLinux needs to have a whole opened in it for Squid.

Avatar of arnoldarnold🇺🇸

check whether you have an exe exclusion in the squid.conf or your web content filter, if any.

Avatar of bwaskbwask🇺🇸

ASKER

I don't have an exclusion for .exe files. But forget about the .exe link, it won't go here either:
ftp://ftp.fedex.com/pub/us/software/

Works fine if I take it off the proxy.

My error is different now since I disable SELinux however:
The following error was encountered while trying to retrieve the URL: ftp://ftp.fedex.com/pub/us/software/

Read Timeout

The system returned: [No Error]

A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.

Your cache administrator is root.

My guess is that the squid mirror link above uses some http front end and the the ftp links that are not working are talking directly to an ftp server because they just through up the standard "tree view" in the browser.

The squid mirror link had some icons and other eye-candy when I pulled it up. I don't think it's purely FTP, just a guess however.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of arnoldarnold🇺🇸

Did you add the SSL_port 1024-23000?

After the connection is established to the server, a PASV connection requires that a second connection from your FTP client be made to a port specified by the remote server when PASV mode was set.

Does you squid's access log indicate that a connection is being denied?

The problem is that the PASV mode ports on the ftp server differ in ranges by the server's configuration.
fedex has/uses a 1600-2200 range for incoming passive FTP connections.

Avatar of bwaskbwask🇺🇸

ASKER

Is this what you meant:
acl SSL_ports port 443 1024-23000

If it is, still no joy. Same issue.

Avatar of arnoldarnold🇺🇸

Try and restart the proxy.

acl SSL_ports port 21
acl SSL_ports port 443
acl SSL_ports port 1024-23000

If you've made other alterations, could you repost the current squid config?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of bwaskbwask🇺🇸

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of arnoldarnold🇺🇸

Could you post the logs dealing with the FTP access entries?
Do you still get a Deny on connections to port 21? or is that not an issue any more and you get the second connection as the issue.  Make sure you have Passive ftp connection.

Linux

Linux

--

Questions

--

Followers

Top Experts

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.