如何使用sh或终端从ubuntu机器打开远程ubuntu机器上的终端

时间:2021-12-15 00:12:35

For remote connection: ssh -Y remoteuser@remoteip

对于远程连接:ssh -Y remoteuser @ remoteip

I need to open terminal in remote machine only; for example a gnome-terminal.

我只需要在远程机器上打开终端;例如一个侏儒终端。

1 个解决方案

#1


1  

This is a typical use case for a library such as Jsch:

这是Jsch等库的典型用例:

JSch is a pure Java implementation of SSH2.

JSch是SSH2的纯Java实现。

JSch allows you to connect to an sshd server and use port forwarding, X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs.

JSch允许您连接到sshd服务器并使用端口转发,X11转发,文件传输等,您可以将其功能集成到您自己的Java程序中。

Beyond that: please understand that not every language is suited for all kinds of problems - personal opinion here: I would rather avoid using Java for tasks such as "controlling a remote system" somehow. First of all; I would avoid re-inventing the wheel; you really want to rely on existing solutions. But instead of programming something in Java, I would rather look to other solutions, such as scripting with python; or using tools such as salt, puppet, chef, ...

除此之外:请理解并非所有语言都适用于所有类型的问题 - 个人意见:我宁愿避免使用Java来完成诸如“以某种方式控制远程系统”之类的任务。首先;我会避免重新发明*;你真的想依靠现有的解决方案。但是,我宁愿选择其他解决方案,例如使用python编写脚本,而不是使用Java编程。或使用盐,木偶,厨师等工具......

#1


1  

This is a typical use case for a library such as Jsch:

这是Jsch等库的典型用例:

JSch is a pure Java implementation of SSH2.

JSch是SSH2的纯Java实现。

JSch allows you to connect to an sshd server and use port forwarding, X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs.

JSch允许您连接到sshd服务器并使用端口转发,X11转发,文件传输等,您可以将其功能集成到您自己的Java程序中。

Beyond that: please understand that not every language is suited for all kinds of problems - personal opinion here: I would rather avoid using Java for tasks such as "controlling a remote system" somehow. First of all; I would avoid re-inventing the wheel; you really want to rely on existing solutions. But instead of programming something in Java, I would rather look to other solutions, such as scripting with python; or using tools such as salt, puppet, chef, ...

除此之外:请理解并非所有语言都适用于所有类型的问题 - 个人意见:我宁愿避免使用Java来完成诸如“以某种方式控制远程系统”之类的任务。首先;我会避免重新发明*;你真的想依靠现有的解决方案。但是,我宁愿选择其他解决方案,例如使用python编写脚本,而不是使用Java编程。或使用盐,木偶,厨师等工具......