如何向putty发送命令

发布于 2024-07-14 22:34:53 字数 118 浏览 6 评论 0原文

我正在用 C 编写一个简单的可执行文件,需要打开 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.

Any ideas??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

静待花开 2024-07-21 22:34:53

来自 PuTTY 常见问题解答

如何使用 PuTTY 进行 SSH
来自另一个人内部的联系
程序?

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

这就是 CVS for Windows 所做的事情,因为
示例。

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

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

From the PuTTY FAQ:

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

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.

This is what CVS for Windows does, for
example.

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

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

凉墨 2024-07-21 22:34:53

使用 DLL,卢克。 http://www.winputty.com/

Use the DLL, Luke. http://www.winputty.com/

一瞬间的火花 2024-07-21 22:34:53

您是否查看过 QuickPutty 的源代码? 它已获得 LGPL 许可。

Have you looked at the source for QuickPutty? It's LGPL licensed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文