远程应用可以通过X11转发使用本地USB设备吗?

时间:2011-04-13 14:51:23

标签: usb local x11-forwarding

我正在运行远程应用程序并使用x11转发在我的屏幕上显示它。我可以让远程应用程序使用我的LOCAL USB端口访问设备(例如USB磁盘)吗?如果是,请详细说明。

谢谢!

1 个答案:

答案 0 :(得分:0)

如果您只需要读取/写入USB驱动器上的文件,这应该可以正常工作。

您可以使用sshfs:

将本地USB安装在远程计算机上

您需要在两台计算机上安装ssh:

$sudo apt-get install ssh

插上你的usb棒。你可能会有automount,如果没有,手动安装usb驱动器:

$sudo mkdir /media/localUSB
$sudo shown YOUR_LOCAL_USER /media/localUSB 
#replace YOUR_LOCAL_USER with your current user name of the local machine
$sudo mount /dev/sdbX /media/localUSB 
#replace X with your usb device number

然后你需要在远程计算机上安装sshfs:

$sudo apt-get install sshfs

在远程计算机上为usb棒创建一个挂载点:

$sudo mkdir /media/remoteUSB
$sudo shown YOUR_REMOTE_USER /media/remoteUSB 
#replace YOUR_REMOTE_USER with your current user name of the remote machine

最后,使用sshfs:

安装它
$sshfs LOCAL_COMPUTER_ADRESS:LOCAL_USB_MOUNT_POINT /media/remoteUSB  -o ssh_command="ssh -l YOUR_REMOTE_USER" #l is L, not one
#replace LOCAL_COMPUTER_ADRESS with your local computer ip or host name
#replace LOCAL_USB_MOUNT_POINT with the directory whre the usb is mounted. If you made de manual mounting process, it should be: /media/localUSB
#replace YOUR_REMOTE_USER with your current user name of the remote machine

我不知道你是否可以使用sshfs远程挂载/ dev / sdbX。如果您需要直接访问USB端口,您应该尝试一下,但我从未这样做过。