Operating System - HP-UX
1829466 Members
1918 Online
109991 Solutions
New Discussion

Re: Cannot telnet to machine via a port

 
Shaamil
Frequent Advisor

Cannot telnet to machine via a port

Hi all
I have an issue whereby I cannot telnet to my machine via a specified port.
We have a process, which runs on the server which allows users to log into the server via a specified port number. Ever so often this mechanism does not work. The error I got when I tried to telnet to the server was:
#> telnet `hostname1` portnumber
Trying...
Connected to `hostname`
Escape character is '^]'.
SetSockOpt: Invalid argument
Connection closed by foreign host.

Also I checked the syslog & their was another error: Too many files open.
HP is the greatest
6 REPLIES 6
Paula J Frazer-Campbell
Honored Contributor

Re: Cannot telnet to machine via a port

Hi

Check your nfiles settings.

Paula
If you can spell SysAdmin then you is one - anon
steven Burgess_2
Honored Contributor

Re: Cannot telnet to machine via a port

Hi

I would check the server to ensure that the process is actually listening on that port at the particular time you are attempting to log in

use lsof to do this

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.64/

HTH

Steve
take your time and think things through
Jin Zhou
Occasional Contributor

Re: Cannot telnet to machine via a port

Is it a 64bit binary?
when there is strange problem that happens intermittently, at least in all my cases, it's always 64bit things.

If that is the case, I guess there is little you can do other than compile the program in 32bit mode. This always solves problems.
Bill Douglass
Esteemed Contributor

Re: Cannot telnet to machine via a port

The "Too many open files" error indicates that you need tp increase either maxfiles or nfiles. These are kernel parameters that control the number of open files per user (maxfiles) and system-wode (nfiles).

Use SAM, go to kernel configuration - configurable parameters. You can set new values for both parameters. Be aware that you will have to reboot after this, so do it during a maintenance window.
Mel Burslan
Honored Contributor

Re: Cannot telnet to machine via a port

the 'too many files open' error indicates that your nfiles kernel parm is too low to handle opening all the necessary files for your processes, which may or may not be the root cause of your not being able to telnet to your machine at the specified port. But it is a good practice to bump it up when you have a chance to take the machine down for maintenence. Saves you some grief later.

On the other hand, this line

'SetSockOpt: Invalid argument'

is troubling. As if the service definition for this port somehow got a 'bug' for the lack of a better term.

for instance if we look at the telnet service which is listening on port 23 by default, you will see :

1) in /etc/services
telnet 23/tcp # Virtual Terminal Protocol

2) in /etc/inetd.conf
telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b /etc/issue


when you compare these lines to the respective lines of listening service on the specified port on your machine, it feels like your argunments/paramaters may be configured wrongly or totally missing. Of course without knowing the specifics of your service, it's very hard to guess the exact nature of the problem.

Also, it is not a very likely scenario here but, check your /var/adm/inetd.sec file if you have one and see if this service is allowed for the machine the request is coming from.

Hope this helps.
________________________________
UNIX because I majored in cryptology...
Steven E. Protter
Exalted Contributor

Re: Cannot telnet to machine via a port

The port is blocked.

Either the service is configured not to accept connections, or inetd.sec is refusing all connections(try another port).

You machine could be having GSP or network problems and dropping off the lan like my currently stricken L2000 box.

I think the too many files message may be connected only if it directly coincides with the reject.

Try this step to be sure.

On the target machine:

tail -f /var/adm/syslog/syslog.log

this will give you a running stream of that file

Then to the connect.

If the message pops up soon after the connect try or instantaneously, you have a winner. If not, you have two problems.

Good Luck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com