简体   繁体   中英

How to ssh using ActiveState's 'Expect' for Windows

I've been racking my brain trying to figure out, mush less find, a tutorial that shows how to use ActiveState's Expect utility to ssh to another server. I cannot find how to simply ssh into a server and run something simple (like 'ls') and disconnect.

The demos folder does not contain the tkremotes.tcl script the documentation claims, but I did find a copy of it here . Looking at this, I don't understand how they are making the ssh connection, if at all.

Use KiTTY (modded version of PuTTY). It has everything you need: saves password & user, executes commands and exits automatically).

Since 2018, as detailled with " Windows Command-Line: Introducing the Windows Pseudo Console (ConPTY) ", Windows 10 does have an option natively.

The issue was:

One of those weaknesses is that Windows tries to be “helpful” but gets in the way of alternative and 3rd party Console developers, service developers, etc.

When building a Console or service, developers need to be able to access/supply the communication pipes through which their Terminal/service communicates with command-line applications.
In the *NIX world, this isn't a problem because *NIX provides a “Pseudo Terminal” (PTY) infrastructure which makes it easy to build the communication plumbing for a Console or service, but Windows does not … until now!

But, as illustrated with creack/pty (a Go package for using unix pseudo-terminals) and its issue 95 , this new feature is not always integrated.

That issue just referenced now (Nov. 2020) conpty from ActiveTest:

Support for the Windows pseudo console in Go.

Developed as part of the cross-platform terminal automation library expect for the ActiveState state tool .

So Windows support for expect might finally be here! (7 years later)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM