PuTTY in console window

2

3

I'd like to use PuTTY the same way I would use ssh on Linux, i.e. from the command line, without spawning a new window. The reason for doing so is that I want to use it from the integrated terminal of an IDE. So I don't want external windows popping out.

I know I can do this with Plink, which is shipped with PuTTY, but Plink has a few problems:

  1. if you use cmd.exe, it gets jammed by color control sequences (this is not a big problem, because PowerShell handles colors fine)
  2. special keys, like arrows, are not sent to the server, so no history and no moving left/right in the line being written.

So, is there a way to solve problem 2. in Plink? Or is there a way to have Linux-like command-line ssh without these problems (with PuTTY or with something else)?

lodo

Posted 2017-04-27T09:55:40.220

Reputation: 131

3

Why don't you try Cygwin? I started using it instead of Putty for this exact reason.

– simlev – 2017-04-27T10:13:05.947

Answers

1

I tried the tool proposed by Martin Prikryl in his answer, but unfortunately I had some problem with it.

Luckily, I found this [1] other build of OpenSSH which worked fine. It's apparently exactly the same thing (a build of OpenSSH for Windows).

[1] http://www.mls-software.com/opensshd.html

lodo

Posted 2017-04-27T09:55:40.220

Reputation: 131

MLS Software's opensshd is a Cygwin package, as is apparent by the presence of cygwin1.dll and the fact that they ship the cygwin source code. – simlev – 2017-05-12T15:30:38.190

3

There's Microsoft build of OpenSSH for Windows.

It includes OpenSSH ssh.exe, that's a console application with a full terminal support.

On Windows 10 version 1803 or newer, you already have OpenSSH built-in. On older versions of Windows 10, it can be installed as an optional Windows feature. On older versions of Windows, you can just extract the client-side tools from a .zip (latest release), no installation is need.


PuTTY is a GUI application. It's not possible for a GUI application to use a console in Windows.

Plink deliberately lacks some terminal features, as it is intended for automation, not for an interactive use. See PuTTY wish plink-terminal.

Martin Prikryl

Posted 2017-04-27T09:55:40.220

Reputation: 13 764

Unfortunately, that build does not work on my system, for some reason. Luckily, I found another build of OpenSSH that works fine. See my answer. – lodo – 2017-04-27T12:31:37.373

When I try to connect, it says me that the fingerprint is not known, so it asks me to type "yes" or "no" to allow or block the connection (cause it doesn't trust it). But I cannot type in that terminal! For some reason it does not accept any input. The other package contains exactly the same command, with exactly the same option and the same behaviour, but I can type in it fine. – lodo – 2017-04-27T12:34:30.150

In fact, that's really a strange bug. I don't know what could prevent me from typing there. Luckily the other build works. So it's probably a matter of version. – lodo – 2017-04-27T12:39:04.547

1

I have posted a bug report: https://github.com/PowerShell/Win32-OpenSSH/issues/692 - You can subscribe it to give it higher visibility.

– Martin Prikryl – 2017-04-27T12:48:45.223