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

| 我正在运行一个远程应用程序,并使用x11转发将其显示在屏幕上。我可以让远程应用程序使用我的本地USB端口访问设备(例如USB磁盘)吗?如果是这样,请详细过程。 谢谢!     
已邀请:
如果您只需要在USB驱动器上读取/写入文件,则可以完成此工作。 您可以使用sshfs在远程计算机上安装本地USB: 您需要在两台计算机上都安装ssh:
$sudo apt-get install ssh
插入您的USB记忆棒。您可能会自动挂载,如果没有,请手动挂载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端口,则应该尝试一下,但我从未尝试过。     

要回复问题请先登录注册