1847416 Members
3065 Online
110264 Solutions
New Discussion

Telnet and Port(s)

 
SOLVED
Go to solution
KPS
Super Advisor

Telnet and Port(s)

I have 2 questions about telnet.

1.) Is it possible to change it's default port that it uses from port 23 to something else? If so how would I go about doing this?????


2.) Is it possible to have telnet use a range of ports? If so how would I go about doing this?????


Thanks,
KPS
7 REPLIES 7
Jeff_Traigle
Honored Contributor

Re: Telnet and Port(s)

Nope. (At least not without recompiling from modified source code.)
--
Jeff Traigle
Torsten.
Acclaimed Contributor

Re: Telnet and Port(s)

1) Yes, but why?
You may adjust the settings in /etc/services and you need to connect like this:
telnet hostname port

But again: why?

2) IMHO that make no sense.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Jeff_Traigle
Honored Contributor

Re: Telnet and Port(s)

Oops. Bad me. I wasn't thinking clearly. Torsten is correct.
--
Jeff Traigle
KPS
Super Advisor

Re: Telnet and Port(s)

We have an Application that behaves very badly with telnet and that may require it because of our customized setup and I guess the way we've set it up in the past.

I appreciate the answers to these.

Thanks,
KPS
Matti_Kurkela
Honored Contributor

Re: Telnet and Port(s)

I assume you are talking about the telnet server side, aka "telnetd".
The telnet client can usually take a port number, for example:
"telnet somehost.example 1234"

1.) You might edit the "telnet..." line in /etc/services, then restart inetd.

But why bother? Changing the telnet port number is just security by obscurity, and not very good at that. There are certainly port scanners and network traffic sniffers that can easily identify a telnet server response without relying on port numbers at all.

If you want security, encryption is the way to go. Just install OpenSSH and disable telnet entirely.

If you cannot get rid of telnetd, at least use /var/adm/inetd.sec (or tcpwrappers) to limit access to it. Allow only the clients you need, and block everything else.

2.) Why would you do this? Telnetd (or, more accurately, inetd) can handle any number of simultaneous connections as-is. Just make sure you have enough PTYs available. Use SAM to change kernel configuration if necessary; the variables are "nstrpty" and "nstrtel".

There is nothing to prevent you from assigning several names like "telnet1", "telnet2", "telnet3" etc. to arbitrary port numbers in /etc/services and then configuring /etc/inetd.conf to start a telnetd process if anyone tries to connect to those ports.

MK
MK
Torsten.
Acclaimed Contributor
Solution

Re: Telnet and Port(s)

On a test system I changed /etc/services telnet entry from 23 to 23333 followed by
/usr/sbin/inetd -c
If I run
telnet testsystem 23333
it is working fine.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
KPS
Super Advisor

Re: Telnet and Port(s)

Folks I have been given some great answers.

Thanks to all for your recommendations...


KPS