• 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 ZFS : How to Designate Hot Spares in a Storage Pool
  2. Solaris : How to include date and timestamp in bash shell command history
  3. The ultimate Solaris jumpstart troubleshooting guide
  4. Solaris : How to find number of open files by a process
  5. How to Configure iSCSI targets on Solaris 10
  6. Solaris : How to Troubleshoot “Unable to mount NFS mount point”
  7. Oracle VM Server for SPARC (Ldoms) : How to Change Primary/Control Domain’s UUID
  8. Solaris Performance troubleshooting : Disk (I/O) performance issues
  9. What are Oracle Solaris 11 Installation Methods
  10. How to find Number of Physical/Logical CPUs, cores and memory in Solaris

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright