Operating System - HP-UX
1833991 Members
3672 Online
110063 Solutions
New Discussion

Re: Chnaging telnet default port

 
nag_2
Occasional Contributor

Chnaging telnet default port

Hi,
I want to chenge default telnet port of HPUX 11.x system.How can I do that.

Please help me in that.

Thanks

-Nagaraj
have nice sys admin time
5 REPLIES 5
Denver Osborn
Honored Contributor

Re: Chnaging telnet default port

# vi /etc/services
change the following:
telnet 23/tcp

Change 23 to the new port, make sure the new port isnt already in /etc/services..

After making changes execute:
# inetd -c

# Telnet hostname:port
Denver Osborn
Honored Contributor

Re: Chnaging telnet default port

sorry - when you telnet to it from a host using default telnet port, type:

# telnet hostname port
Kofi ARTHIABAH
Honored Contributor

Re: Chnaging telnet default port

Nag:

You have to do the following:
1. Edit the /etc/services file to add the entry for your newtelnet eg.

# echo "newtelnet 12345/tcp #newtelnet port" >> /etc/services

2. modify your /etc/inetd.conf and comment out the entry for telnet; and create a new entry with the newtelnet entry:

# vi /etc/inetd.conf
(comment out the line with telnet)
(create a new line exactly like the commented line but replace telnet in the first column with "newtelnet" - you should have the following lines:

#telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
newtelnet stream tcp nowait root /usr/sbin/tcpd in.telnetd

3. Now restart inetd (to re-read the config files) with
# inetd -c

do a netstat -a to make sure that you no longer have your server listening on the telnet port, but rather, the newtelnet port.

now you can test this by

# telnet server newtelnet

Good luck.

nothing wrong with me that a few lines of code cannot fix!
Kofi ARTHIABAH
Honored Contributor

Re: Chnaging telnet default port

By the way if you are changing it for security reasons, you have to remember that no matter what port you run telnet on, it can still be sniffed with ethereal or tcpdump... if you really want security, you probably should go with ssh.

good luck
nothing wrong with me that a few lines of code cannot fix!
R Meijer
New Member

Re: Chnaging telnet default port

ah, security by obscurity
you sound like my employer!
my advice, disable telnet and go for ssh