如何向putty发送命令 [英] How to send commands to putty

查看:129
本文介绍了如何向putty发送命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 C 编写一个简单的可执行文件,它需要打开一个 putty 会话并向其发送命令,然后关闭 putty.我可以打开/关闭 putty 会话(我还不错),但我不太确定如何向 putty 发送命令.

I'm writing a simple executable in C that needs to open a putty session and send commands to it, then close putty. I can open/close the putty session (i'm not that bad) but i'm not too sure on how to send putty the commands.

有什么想法吗??

推荐答案

来自 PuTTY 常见问题:

如何使用 PuTTY 制作 SSH来自另一个内部的连接程序?

How can I use PuTTY to make an SSH connection from within another program?

可能你最好的选择是使用Plink,命令行连接工具.如果您可以将 Plink 作为第二个Windows进程,并安排使您的主要流程能够将数据发送到 Plink 进程,以及通过管道从它接收数据,那么你应该能够制作SSH来自您的程序的连接.

Probably your best bet is to use Plink, the command-line connection tool. If you can start Plink as a second Windows process, and arrange for your primary process to be able to send data to the Plink process, and receive data from it, through pipes, then you should be able to make SSH connections from your program.

这就是 CVS for Windows 所做的,因为示例.

This is what CVS for Windows does, for example.

Plink 除了可以直接打开网站外,还可以使用 PuTTY 保存的会话.

Plink can use PuTTY's saved sessions in addition to opening sites directly.

PLink 的选项记录在 第 7 章PuTTY 手册.

PLink's options are documented in Chapter 7 of the PuTTY manual.

这篇关于如何向putty发送命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆