开发者

can local usb device be used by remote application through X11 forwarding?

开发者 https://www.devze.com 2023-02-25 02:49 出处:网络
I am running a remote application and use x11 forwardin开发者_如何学运维g 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, de

I am running a remote application and use x11 forwardin开发者_如何学运维g 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消