Operating System - HP-UX
1753723 Members
4659 Online
108799 Solutions
New Discussion юеВ

SO_KEEPALIVE: Invalid argument

 
SOLVED
Go to solution
MikeL_4
Super Advisor

SO_KEEPALIVE: Invalid argument

We are getting floaded with keepalive messages in syslog.log:

sshd[11628]: error: setsockopt SO_KEEPALIVE: Invalid argument

I don't see in the /opt/ssh/etc/sshd_config file where this parameter is even set ??

What do I need to do ??
11 REPLIES 11
MikeL_4
Super Advisor

Re: SO_KEEPALIVE: Invalid argument

Additional information:

ndd -h |grep -i keepalive
tcp_keepalive_detached_interval - Send keepalive probes for detached TCP
tcp_keepalive_interval - Interval for sending keepalive probes
tcp_keepalives_kill - Types of keep-alive probe to use


ndd -get /dev/tcp tcp_keepalive_detached_interval
120000
ndd -get /dev/tcp tcp_keepalive_interval
900000
ndd -get /dev/tcp tcp_keepalives_kill
1
MikeL_4
Super Advisor

Re: SO_KEEPALIVE: Invalid argument

ssh -V
OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.50.003, HP-UX Secure Shell version
Patrick Wallek
Honored Contributor
Solution

Re: SO_KEEPALIVE: Invalid argument

I don't know if this will help you or not, but have a look here:

http://www.hummingbird.com/support/nc/issues/con1003215.html?cks=y

Andrew Rutter
Honored Contributor

Re: SO_KEEPALIVE: Invalid argument

hi mikeL,

it should be listed as TCPKeepAlive in the sshd config file?

http://docs.hp.com/en/T1471-90015/ch01s14.html

if you find it then change this to value to no

if this doesnt help post back with os version and more info

Andy

Matti_Kurkela
Honored Contributor

Re: SO_KEEPALIVE: Invalid argument

Which version of SSH are you using?

If it's from HP, review the release notes of that SSH version (should be available at docs.hp.com). There might be a recommendation to install some patches.

The error message is related to a setsockopt() system call. "man 2 setsockopt" for more information.

The "Invalid argument" error, or EINVAL, is described in the man page as follows:
"The level or optlen value is not valid; or optval is the NULL address; or the protocol connection has been released."
The words "level", "optlen" and "optval" refer to the arguments of the setsockopt() system call.

Note the last possible cause of the EINVAL error: "...or the protocol connection has been released."

My wild guess:
This might be caused by a port scan, possibly using some "stealthy" method: sshd receives something that initially looks like a new connection, but when sshd gets to the point of running setsockopt(), the connection is already gone.

If it was me, I'd like to set up a network sniffer to pick up the first few packets of each connection incoming to the sshd port of your server.

Then find out if the beginning of each connection looks like a standard TCP three-way handshake or something different: it might be that the "client" always aborts the connection in the earliest possible phase. If anomalous connections are found, you might want to look where they're coming from.

MK
MK
MikeL_4
Super Advisor

Re: SO_KEEPALIVE: Invalid argument

ssh -V
OpenSSH_4.5p1+sftpfilecontrol-v1.1-hpn12v14, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.50.003, HP-UX Secure Shell version

T1471AA A.04.50.003 HP-UX Secure Shell
Andrew Rutter
Honored Contributor

Re: SO_KEEPALIVE: Invalid argument

hi,

you could also check if you are using this config file ?

/etc/ssh/sshd_config

http://unixhelp.ed.ac.uk/CGI/man-cgi?sshd_config+5


Also the release notes are here

http://www.docs.hp.com/en/internet.html#Secure%20Shell

have you just started getting these errors? have any changes been made to prompt them

Andy
MikeL_4
Super Advisor

Re: SO_KEEPALIVE: Invalid argument

The only change was that this new version of SSH was installed last weekend.

T1471AA A.04.50.003 HP-UX Secure Shell
Andrew Rutter
Honored Contributor

Re: SO_KEEPALIVE: Invalid argument

hi,

well even that version is slightly out of date

newer version is here

http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

but as always, if you install newer versions of software make sure you have all the updated patches aswell installed from the patch database

Andy