Change Telnet port in Linux (Debian)

85885 pts.
Incident response
Intrusion management
Network protocols
Network security
Hello everybody. I'm not a Linux expert, and am looking for a way to securely communicate with a Linux machine via Telnet. To avoid sending user and pwd without encryption I'm going to open a ssh tunnel (with putty or plink) forwarding port 22 (ssh) on the linux machine to another port, in which the telnet daemon will be listening (other than the default port 23). But I don't know how to change the port in which Telnet daemon listens, in Debian. The reason why I need to use Telnet is because I need to send some commands from a VB application (or VC++), and I have no controls for communication with ssh ( there are such controls in the market, but they are not free :-) ) Any help or comment will be really appreciated. Thanks in advance.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t understand why you want to change the port. There is no issue with using SSH to port forward to telnet port. In your client simply say that you want to forward the local port X to port 23 on the Linux server. Then tell your app to connect to port X on localhost.

But if you want to change the port then this is done in /etc/xined.d/telnet assuming Debian is using xinetd. Or if it’s using inetd then the port where telnetd listens is defined by /etc/inetd.conf

I also have a hard time beleiving there is no free SSH controls for Windows. There is multiple SSH libraries in the UNIX world, and I woul presume some of them is ported to Windows.. but Windows is not my field.

Discuss This Question: 6  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Madmax2
    There are several SSH tools for Windows. One that might interest you is called Cygwin. This would not only give you a native SSH it would give you access to most Linux commands, apache, and x/windows if you wanted. Best of all it is free. I must warn you the installer is a bit touchey. I usally have it download the files and install locally.
    0 pointsBadges:
  • Dbnetsi
    You can intergate putty entirely or components in your program,just need the due recognition as documented on the Putty website. It would be best to use this as it is ssh2 compliant and is actively developed and the source code is available so in theory you can simply reuse the source if that doesn't breach the putty license. Alternatively depending on the nature of the tasks you could use perl; Net-SSH-Perl if that doesn't cause you problems.
    0 pointsBadges:
  • Larrythethird
    I agree with dbnetsi. Putty is free and easy to use. Comes with plenty of tools to do anything you need. Maybe a little more reading on how ssh2 works would be beneficial. Try here:
    0 pointsBadges:
  • Lowcostcmts
    Use Putty to create the SSH tunnel from Windows to the Server, Then forward you telnet connection through the tunnel
    0 pointsBadges:
  • carlosdl
    I really appreciate your help. Thank you. Initially I wanted to change the telnet port for security reasons, but now, at henriknordstrom suggestion, I'm using iptables to only accept connections on port 23 if they come from localhost, and as I said before, with plink (putty command-line version) I open a ssh tunnel from within my application and forward the telnet connection through it. I have the putty source code, and I will surely take a look at it, but by now, I solved my problem. I will try Cygwin too. kindest regards,
    85,885 pointsBadges:
  • Beirne
    It isn't real clear to me why you need Telnet at all since you have SSH working and are logged into the Linux server. If you want to run something on the Linux system just provide the commandd as an argument to plink and it will run on the back end. If there are several commands it might be easiest to combine them into a shell script on the Linux server and have it take parameters for whatever it needs to do.
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: