This will depend upon what you have localhost defined as in the acl for localhost
if your localhost acl is defined as
acl localhost src 127.0.0.1/255.255.255.255
which is is normally by default then it will ONLY allow connections from the loopback adapter and I would guess that squid is seeing the connection as coming from what ever IP address is assigned to the network card you are SSHing into.
Try adding the following acl and http_access entries you will have to use the ip address of your server in this example i have assumed your server is on the IP 10.0.0.1 but change it to the real address, I believe it should work.
This entry goes along with the other ACLs it does not matter what order they are in.
acl my_network_card src 10.0.0.1/255.255.255.255
Then add this line to the http_access lines, it must go before the deny line ! I have added the other lines for clarity here.
http_access allow localhost
http_access allow my_network_card
http_access deny all
This basically says allow connections from localhost. If that fails allow connections that Originate from my network card if that fails deny access.