Discussion:
[clamav-users] Connection Refused error
(too old to reply)
Ravi Maddi
2016-07-25 14:44:10 UTC
Permalink
Hi Al,
I am new to clamav. I am able to install it on RHEL AWS environment and
enabled it to run on port 3310.

[ec2-***@ip-172-30-0-245 ~]$ sudo netstat -anp |grep 3310
tcp 0 0 127.0.0.1:3310 0.0.0.0:*
LISTEN 2421/clamd

However, I am trying to access it from the java program and I am getting
connection refused error. Attached is the java program that tries to
connect to clamd.

Can you please shed some light into this problem?

Below is the java program stacktrace:
==============================

2016-07-25 09:37:10,215 [main] DEBUG n.taldius.clamav.impl.NetworkScanner -
net.taldius.clamav.ScannerException: Error while requesting protocol channel
net.taldius.clamav.ScannerException: Error while requesting protocol channel
at
net.taldius.clamav.impl.NetworkScanner.openProtocolChannel(NetworkScanner.java:163)
at
net.taldius.clamav.impl.NetworkScanner.performScan(NetworkScanner.java:57)
at
com.ecorrservices.util.ClamAVVirusHandler.fileScanner(ClamAVVirusHandler.java:90)
at
com.ecorrservices.util.ClamAVVirusHandler.fileScanner(ClamAVVirusHandler.java:76)
at
com.ecorrservices.util.ClamAVVirusHandler.main(ClamAVVirusHandler.java:102)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at
net.taldius.clamav.impl.NetworkScanner.openProtocolChannel(NetworkScanner.java:139)
... 4 more
Out put == false

Thank you,
Ravi
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Dennis Peterson
2016-07-25 17:39:29 UTC
Permalink
Try a simple test of the clamd connection with:

echo "PING" | nc localhost 3310

It should return "PONG". If it does your problem is not related to clamd.

dp
Post by Ravi Maddi
Hi Al,
I am new to clamav. I am able to install it on RHEL AWS environment and
enabled it to run on port 3310.
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Ravi Maddi
2016-07-25 18:20:15 UTC
Permalink
Thank you Dennis for your swift response. Yes, I got PONG as the response.

We are looking into firewall settings. Appreciate your swift response.

Best regards,
Ravi
Post by Dennis Peterson
echo "PING" | nc localhost 3310
It should return "PONG". If it does your problem is not related to clamd.
dp
Post by Ravi Maddi
Hi Al,
I am new to clamav. I am able to install it on RHEL AWS environment and
enabled it to run on port 3310.
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Ravi Maddi
2016-07-25 20:17:35 UTC
Permalink
Hi Dennis,
I am trying to connect to a Clam AV running on a separate linux box...and
if there is some configuration I have to do to connect? Or, Clam AV even
allows that?

The fact that you take `hostname` parameter makes me think it's possible.
But, I am getting connection refused error.

Thank you so much!

Best,
Ravi
Post by Ravi Maddi
Thank you Dennis for your swift response. Yes, I got PONG as the response.
We are looking into firewall settings. Appreciate your swift response.
Best regards,
Ravi
Post by Dennis Peterson
echo "PING" | nc localhost 3310
It should return "PONG". If it does your problem is not related to clamd.
dp
Post by Ravi Maddi
Hi Al,
I am new to clamav. I am able to install it on RHEL AWS environment and
enabled it to run on port 3310.
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Matus UHLAR - fantomas
2016-07-26 06:16:26 UTC
Permalink
Post by Ravi Maddi
I am trying to connect to a Clam AV running on a separate linux box...and
if there is some configuration I have to do to connect? Or, Clam AV even
allows that?
The fact that you take `hostname` parameter makes me think it's possible.
But, I am getting connection refused error.
apparently clamav on the second host only listens on local interface, check
if TCPSocket is defined in clamd.conf
--
Matus UHLAR - fantomas, ***@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux is like a teepee: no Windows, no Gates and an apache inside...
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Dennis Peterson
2016-07-26 17:11:40 UTC
Permalink
Your previous post showed your clamd instance is bound to the loopback interface
and as such other systems cannot connect. But even if they could what would they
do? You surely don't want to ship whole file systems across your network for
scanning, do you? That would also be required if you wish to scan email
attachments. It can be done (think NFS) but the network traffic may surprise you.

dp
Post by Ravi Maddi
Hi Dennis,
I am trying to connect to a Clam AV running on a separate linux box...and
if there is some configuration I have to do to connect? Or, Clam AV even
allows that?
The fact that you take `hostname` parameter makes me think it's possible.
But, I am getting connection refused error.
Thank you so much!
Best,
Ravi
Post by Ravi Maddi
Thank you Dennis for your swift response. Yes, I got PONG as the response.
We are looking into firewall settings. Appreciate your swift response.
Best regards,
Ravi
Post by Dennis Peterson
echo "PING" | nc localhost 3310
It should return "PONG". If it does your problem is not related to clamd.
dp
Post by Ravi Maddi
Hi Al,
I am new to clamav. I am able to install it on RHEL AWS environment and
enabled it to run on port 3310.
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Ravi Maddi
2016-07-26 17:23:04 UTC
Permalink
We are trying to avoid installing clamd in developers workstations and
instead let the integration server scan email attachments for this web
application we are building. Is there any configuration change that lets
my integration server scan file(s)? We can enable ports if needed within
the organization.

Thanks for your help!

Ravi
Post by Dennis Peterson
Your previous post showed your clamd instance is bound to the loopback
interface and as such other systems cannot connect. But even if they could
what would they do? You surely don't want to ship whole file systems across
your network for scanning, do you? That would also be required if you wish
to scan email attachments. It can be done (think NFS) but the network
traffic may surprise you.
dp
Post by Ravi Maddi
Hi Dennis,
I am trying to connect to a Clam AV running on a separate linux box...and
if there is some configuration I have to do to connect? Or, Clam AV even
allows that?
The fact that you take `hostname` parameter makes me think it's possible.
But, I am getting connection refused error.
Thank you so much!
Best,
Ravi
Thank you Dennis for your swift response. Yes, I got PONG as the
Post by Ravi Maddi
response.
We are looking into firewall settings. Appreciate your swift response.
Best regards,
Ravi
Post by Dennis Peterson
echo "PING" | nc localhost 3310
It should return "PONG". If it does your problem is not related to
clamd.
dp
Hi Al,
Post by Ravi Maddi
I am new to clamav. I am able to install it on RHEL AWS environment
and
enabled it to run on port 3310.
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Dennis Peterson
2016-07-26 17:40:57 UTC
Permalink
If you are storing your files on a NAS, SAN or de-dupe storage device it can be
done easily by attaching your central server to those NAS/SAN/de-dupe devices.
That puts the traffic on the storage backbone rather than your network, and you
have additional tools available such as snapshots, mirrors, and clones.

If you have to do it over your network then you will require NFS, SAMBA, or
other file sharing protocol that will allow access to the files to be scanned.
File ownerships and permissions become very messy. It will be very slow. If the
dev systems are scattered around the country it will be crazy slow.

dp
Post by Ravi Maddi
We are trying to avoid installing clamd in developers workstations and
instead let the integration server scan email attachments for this web
application we are building. Is there any configuration change that lets
my integration server scan file(s)? We can enable ports if needed within
the organization.
Thanks for your help!
Ravi
Post by Dennis Peterson
Your previous post showed your clamd instance is bound to the loopback
interface and as such other systems cannot connect. But even if they could
what would they do? You surely don't want to ship whole file systems across
your network for scanning, do you? That would also be required if you wish
to scan email attachments. It can be done (think NFS) but the network
traffic may surprise you.
dp
Post by Ravi Maddi
Hi Dennis,
I am trying to connect to a Clam AV running on a separate linux box...and
if there is some configuration I have to do to connect? Or, Clam AV even
allows that?
The fact that you take `hostname` parameter makes me think it's possible.
But, I am getting connection refused error.
Thank you so much!
Best,
Ravi
Thank you Dennis for your swift response. Yes, I got PONG as the
Post by Ravi Maddi
response.
We are looking into firewall settings. Appreciate your swift response.
Best regards,
Ravi
Post by Dennis Peterson
echo "PING" | nc localhost 3310
It should return "PONG". If it does your problem is not related to
clamd.
dp
Hi Al,
Post by Ravi Maddi
I am new to clamav. I am able to install it on RHEL AWS environment
and
enabled it to run on port 3310.
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Matus UHLAR - fantomas
2016-07-27 13:16:32 UTC
Permalink
Post by Ravi Maddi
We are trying to avoid installing clamd in developers workstations and
instead let the integration server scan email attachments for this web
application we are building.
install clamav on mailserver then...
Post by Ravi Maddi
Is there any configuration change that lets
my integration server scan file(s)? We can enable ports if needed within
the organization.
what's an integration server?
--
Matus UHLAR - fantomas, ***@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Micro$oft random number generator: 0, 0, 0, 4.33e+67, 0, 0, 0...
_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Loading...