Search code examples
.nettelnetputtyplink

Set negotiation mode on Plink


I am trying open a TelNet Connection using PLink

My connection string is: plink.exe -telnet -P <Port Number> <IP Address>

Although the connection is opened due to the firewall on the other side I can't login without changing the negotiation mode to passive

Here is how it's changed using Putty

Putty Configuration, Negotiation mode

I was an unable to find a documentation that explained how this can be done using PLink

PLink will eventually be used by a .net program and will log events passed through the connection. So I'm looking for a way to duplicate what Putty does either with PLink or with a .net 4.5 TelNet Nugget package


Solution

  • Do not launch external application to implement Telnet. Use some .NET Telnet library.

    See C# Telnet Library.


    If you want to use Plink anyway:

    Plink does not allow you to set most options using command-line.

    What you can do it to create ad-hoc temporary stored settings in Windows registry and have Plink use that using -load switch.

    For your needs you need to create keys like:

    [HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions\passive_telnet]
    "HostName"="example.com"
    "Protocol"="telnet"
    "PortNumber"=dword:00000017
    "PassiveTelnet"=dword:00000001