Operating System - HP-UX
1753649 Members
5971 Online
108798 Solutions
New Discussion юеВ

How to change telnet client default port?

 
SOLVED
Go to solution
Guna_2
Regular Advisor

How to change telnet client default port?

Hi all,

From a hpux box if we issue the command

#telnet hostname

By default it connects to port No 23. I want to configure the telnet command to connect some other port.

How can i do this?

Thanks and Regards
--MGP--
10 REPLIES 10
Luk Vandenbussche
Honored Contributor
Solution

Re: How to change telnet client default port?

Change the port number in /etc/services
Guna_2
Regular Advisor

Re: How to change telnet client default port?

Hi

If i change the port no in /etc/services. Then my telnet server daemon also will listen only in that new port. I don't want to disturb the telnetd daemon's port.

I want just like, whenever i issue the telnet command it should connect to some other port.

Thanks and Regards
--MGP--
Dennis Handly
Acclaimed Contributor

Re: How to change telnet client default port?

The syntax for telnet is:
telnet [[options] host [port]]
Torsten.
Acclaimed Contributor

Re: How to change telnet client default port?

You can do like suggested but why?
This won't make the system more secure.

For more security, disable telnet and use ssh.

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!   
Guna_2
Regular Advisor

Re: How to change telnet client default port?

Hi dennis,

You are right. But,

I have 2 hpux 11.11 servers.

From server A i am trying to connect server B via telnet

A# telnet B
password:

(logged into the Server B.)

B#netstat -a | grep A
tcp 0 0 B.22 A.58757 ESTABLISHED

The connection has established between the port no. 22.

and in the server B the telnet service itself is disabled in inetd.conf

and in server A the /etc/services the port no specified for telnet is 23.

Then how whenever i issue the command telnet servername it is connecting to 22 port instead of default 23 port?

can anyone please explain me?

Is there any relation between the sshd daemon and this?

Thanks and Regards
--MGP--
Luk Vandenbussche
Honored Contributor

Re: How to change telnet client default port?

If the connection is made on port 22 (and you didn't change anything to the configuration) then you are connecting through ssh
Guna_2
Regular Advisor

Re: How to change telnet client default port?

Hi

Ya all r right.

when i tried stirngs /usr/bin/telnet and /usr/bin/ssh

the content is same.


I think for security purpose some admin has done this.



One more doubt.

In Server B telnet service is disabled in inetd.conf

But in netstat -a | grep LIST output. the telnet port is listening.

tcp 0 0 *.telnet *.* LISTEN

How this is happening?

Thanks and Regards
--MGP--
Luk Vandenbussche
Honored Contributor

Re: How to change telnet client default port?

Perhaps

/usr/lbin/telnetd and /usr/sbin/sshd are also the same.

I find it strange to copy ssh over telnet
Sandman!
Honored Contributor

Re: How to change telnet client default port?

You need to recycle inetd for the changes made to /etc/inetd.conf to take effect. Most likely someone commented out telnetd in the /etc/inetd.conf file but forgot to recycle the inetd daemon.