RDManager是我编写的一个远程管理工具,特点是可以一起管理Windows和Linux服务器。最初的版本是2017年写的,最近几年也一直在用,有些小毛病一直不爽,今天改了一下。

原因

之前集成的Poderosa是一个比较早期的版本,使用SSH Shell的场景中,有时会出现不支持新协议,导致无法使用的问题。使用vi命令的时候也会出现一些莫名其妙的小问题。所以一直有换掉的打算。

Poderosa的开源版本也有好几年不维护了,而且结构是插件式的,想提取出来Terminal的部分还比较麻烦。今天看PuTTY一直都有更新,虽然不那么火了,但是日常操作肯定都支持。所以就想着把它直接嵌入到RDManager中。

改变

集成的方式十分简单粗暴,就是用Process启动putty进程,然后摁到一个控件中去。能这样做也是因为putty支持命令行启动,并可以传递一些登录参数。

puttyProcess = new Process(); puttyProcess.StartInfo.WorkingDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "tools"); puttyProcess.StartInfo.FileName = @"putty.exe"; puttyProcess.StartInfo.Arguments = $"-ssh -P {port} -pw {password} {userName}@{ip}"; puttyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; puttyProcess.EnableRaisingEvents = true; puttyProcess.Exited = PuttyProcess_Exited; puttyProcess.Start(); ... ShowWindow(puttyProcess.MainWindowHandle, (short)ShowWindowStyles.SW_MAXIMIZE); SetParent(puttyProcess.MainWindowHandle, this.Handle);

想看代码的去Github吧,这里就不罗嗦了。

https://github.com/bosima/RDManager

效果

再暴几张图,给没用过的人一个直观印象。

Windows远程桌面:

创建rds服务器(RDManager新版本使用PuTTY代替Poderosa)(1)

Linux SSH Shell:

创建rds服务器(RDManager新版本使用PuTTY代替Poderosa)(2)

Linux SSH SFTP:

创建rds服务器(RDManager新版本使用PuTTY代替Poderosa)(3)

,