• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to make telnet listen to a different port in Solaris

by admin

For security purpose, you may want telnet bind to a different port instead of the well-known port 23. It should be noted that changing port numbers of well-known services is also usually a bad idea. In general, services should either be left with their default ports or completely disabled. Changing the default port should only be opted as last option when you want to keep the service as enabled.

Follow the steps below to change the telnet port from 23 to 24.

1. Check if nay other service is listening onto port 24 before proceeding.

$ netstat -an | grep "*.24" | grep LISTEN

2. edit the /etc/services file and edit the line for telnet

telnet          23/tcp

becomes…

telnet          24/tcp

3. restart or hangup inetd…

$ kill -HUP <pid_of_inetd

4. There should now be a listener on port 24.

$ netstat -an | grep "*.23" | grep LISTEN
      *.23                 *.*                0      0 49152      0 LISTEN

5. Telnet to the client by specifying port number to connect to this machine.

$ telnet hostname 24

This works because the inetd “super-server” uses getservbyname(3SOCKET) to obtain the port number from the services database. Please be aware that if you have configured the name service switch to use backends other than “files” then you may also need to alter the name/port mapping in those backends.

Filed Under: Solaris

Some more articles you might also be interested in …

  1. Solaris : Non-root user can’t run prtdiag command
  2. How to log SSH login attempts to a file in Solaris
  3. Script to label multiple disks in Solaris
  4. The ultimate Solaris sendmail troubleshooting guide
  5. The ultimate Solaris networking interview questions
  6. How to Backup and Restore ZFS root pool in Solaris 10
  7. How to Use the ‘truss’ Command for Program and Error Analysis in Solaris
  8. How to add and set new locale in solaris
  9. Beginners Guide to Solaris 11 Network Administration
  10. How to configure NTP client in Solaris 8,9,10 and non-global zones

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright