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

发布于 2024-11-01 05:39:11 字数 105 浏览 12 评论 0原文

我正在运行一个远程应用程序并使用 x11 转发将其显示在我的屏幕上。我可以让远程应用程序使用我的本地 USB 端口来访问设备(例如 USB 磁盘)吗?如果可以请详细的流程。

谢谢!

I am running a remote application and use x11 forwarding to display it on my screen. Can I let the remote application use my LOCAL usb port to access devices (e.g. usb disks)? If so, detailed procedure please.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半仙 2024-11-08 05:39:11

如果您只需要在 USB 驱动器上读/写文件,这应该可以完成工作。

您可以使用 sshfs 将本地 USB 挂载到远程计算机上:

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

$sudo apt-get install ssh

插入您的 U 盘。你可能会自动挂载,如果没有,手动挂载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

在远程计算机上为你的U盘创建一个挂载点:

$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 端口,您应该尝试一下,但我从未这样做过。

This should do the work if you just need to read/write files on a USB drive.

You could mount your local usb on the remote computer using sshfs:

You need to install ssh on both computers:

$sudo apt-get install ssh

Plug your usb stick. You will probably have automount, if not, mount the usb drive manually:

$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

Then you need to install sshfs on the remote computer:

$sudo apt-get install sshfs

Create a mount point for your usb stick on the remote computer:

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

Finally, mount it with 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

I dont know if you can remote mount /dev/sdbX using sshfs. If you need direct access to the USB port you should try it, but I never did it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文