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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to update the boot_archive for ZFS root in Solaris
  2. How to set up cron for automatic data collection from the system activity reporter (SAR) in Solaris 10 and 11
  3. Solaris : How To Create and Mount NFS share that is Restricted to Certain Hosts
  4. How to set boot-device with luxadm command in Solaris
  5. How to create an OBP boot device alias in Solaris [SPARC]
  6. How to check zpool status in Solaris
  7. How to Identify ZFS Snapshot Differences using “zfs diff”
  8. How to log SSH login attempts to a file in Solaris
  9. Solaris 10 (x86/x64) : How to boot into single user mode from the Grub boot loader
  10. How to Check Solaris Release and Default Kernel Version

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • What Is Oracle Key Vault
  • Auditing with Oracle Database Vault Reports
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary