用于 sftp 或 GUI 的 ssh 隧道 [英] ssh tunneling for sftp or GUI

查看:25
本文介绍了用于 sftp 或 GUI 的 ssh 隧道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 ssh 隧道使用 sftp

I am trying to use sftp over an ssh tunnel

我有一个homePC,可以使用gatewayPC作为跳转主机登录远程服务器

I have a homePC, that can use a gatewayPC as a jump host to login to a remoteserver

我使用 ssh 隧道命令

i use the ssh tunnel command

$ssh -t userid@gateway ssh remoteserver

来自 homePC,效果很好

但是,一旦我登录到另一台机器,我想打开一个 nautilus 或任何其他文件管理器

However, I would like to open a nautilus or any other file manager once I am logged into the other machine

一种选择是能够通过此隧道进行 sftp 或 ftp

one option is to be able to sftp or ftp over this tunnel

是否有基于 GUI 的工具(如用于 windows 的 putty)来实现这一点?

Are there GUI based tools like putty for windows in order to make this happen?

感谢任何帮助

问候,希瓦尼

推荐答案

为此你可以使用 ssh 隧道,你必须在路径中创建一个文件:

For that you can use ssh tunnel you must create a file in the path:

atiruz@pc:~$ nano ~/.ssh/config

并添加此文本(根据您的服务器调整):

And add this text (adjusted with your servers):

Host gatewayPC
    HostName 100.110.120.130

Host localPC
    ProxyCommand ssh -A -t root@gatewayPC -p 222 nc 192.168.1.5 22

Host otherPC
    ProxyCommand ssh -A -t localPC nc 10.10.0.55 22

通过这个例子,你可以直接从网关PC到本地PC,只需在终端中运行:

With this example you can go directly from the gatewayPC to the localPC, just run in a terminal:

atiruz@pc:~$ ssh root@localPC

该方案应如本网站中所述.(我做了一个小改动,因为在这个网站的例子中我的 Ubuntu 12.04 上不工作).

The scheme should be as described in this site. (I made a small change, because in the example of this site did not work on my Ubuntu 12.04).

也可以在Nautilus中使用,使用路径如下:

You can also use it in Nautilus with the following path to be used as follows :

在终端中:atiruz@pc:~$ nautilus sftp://root@localPC

或者直接在Nautilus中:sftp://root@localPC

这篇关于用于 sftp 或 GUI 的 ssh 隧道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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