Usb redirector для linux

Установка и настройка usb-redirector-linux в CentOS

В статье пойдет речь о настройке сервера для сетевой передачи устройства USB на другой компьютер. Подобная конструкция, как правило, необходима для проброса различных USB-ключей на виртуальные машины. Серверная часть будет настраиваться на базе Linux CentOS 7, клиентская — Windows. В качестве серверного ПО будем использовать usb-redirector-linux. Внимание — данный продукт нельзя использовать бесплатно, если раздача USB устройства идет с сервера Linux. В большей степени, инструкция предназначена для тех, кто планирует купить данных продукт.

Подготовка сервера

Для корректной установки программы, необходимо обновить систему:

После сервер необходимо перезагрузить:

Настройка сервера

usb-redirector-linux собирается из исходников. Для начала ставим пакеты, необходимые для сборки:

yum install wget gcc kernel-devel

Переходим на страницу загрузки программы и копируем ссылку на ее скачивание:

Используя ссылку, скачиваем исходник на сервер:

Распаковываем скачанный архив и переходим в каталог исходников модулей:

tar -zxvf usb-redirector-linux-x86_64.tar.gz

Собираем исходник с указанием исходника ядра:

* каталог 3.10.0-862.3.3.el7.x86_64, скорее всего, будет другим — это зависит от версии ядра.

Возвращаемся в корень каталога, который появился после распаковывания архива:

Устанавливаем usb-redirector следующей командой:

Проброс USB устройства

Переходим в каталог, куда была установлена программа:

Отображаем список подключенных USB устройств:

Получим что-то на подобие:

================= USB SERVER OPERATION SUCCESSFUL ===============
List of local USB devices:

1: USB Keyboard SIGMACHIP Composite USB Device
Vid: 1c4f Pid: 0026 Port: 2-1.4
Status: plugged

2: ET99 Token OEM USB Human Interface Device
Vid: 096e Pid: 0303 Port: 2-1.3
Status: plugged

Чтобы расшарить токен ET99, вводим:

Настройка клиента

Заходим на страницу загрузки USB Redirector и скачиваем клиентскую часть — в нашем случае для Windows:

Скачанный архив распаковываем и запускаем установщик. Отвечаем на все вопросы мастера нажатием Далее.

После окончания установки запускаем программу — нажимаем Add USB Server и прописываем IP-адрес нашего сервера:

Появится список расшаренных устройств — просто нажимаем правой кнопкой мыши на необходимый и кликаем Connect USB Device.

Источник

USB Redirector for Linux — Share USB over Network in Linux

This Free product allows to share and access USB devices remotely on Linux platform. This solution is compatible with all of our other USB redirection products. It allows redirecting USB devices between Linux based computers or between Linux and Windows. And with help of the special patch, it is possible to add USB redirection support to the well-known open source remote desktop clients, rdesktop and FreeRDP, so that you can redirect USB devices into remote session on Windows computer where USB Redirector RDP Edition or USB Redirector TS Edition are installed.

USB Redirector for Linux helps to:

  • Redirect USB devices to virtual machine.
  • Organize USB server for users in your local or corporate network.
  • Use USB devices plugged into your Linux thin-client in a Windows Remote Desktop session.
  • Use USB devices plugged into remote Windows-based computer.
  • Limit physical access to USB devices, but make them available for users in your network.

Not sure if this version suits your needs?
Compare USB Redirector editions

How to Start

USB Redirector for Linux can be installed in three modes:

  • USB server mode. When installed in this mode, USB Redirector allows to share your USB devices for access on remote computers with Linux or Windows operating systems.
  • USB client mode. When installed in this mode, USB Redirecror allows you to connect remote USB devices that were shared on remote computers with Linux or Windows operating systems.
  • Combined USB server and USB client mode. You can either share your USB devices for remote access or connect USB devices from remote computers with Linux or Windows operating systems.
Читайте также:  Как настроить windows под ssd диск

USB Redirector installation instructions can be found here.

Redirect a USB Device in 5 Steps

  • Step 1. Download and install USB Redirector for Linux in USB server mode on a computer where USB device is physically attached, this computer will be the USB server:

$ usbsrv -list-devices =================== LIST OF LOCAL USB DEVICES =================== 8: Portable Super Multi Drive HLDS Inc — USB Mass Storage Device Vid: 152e Pid: 2571 Port: 1-4 Status: plugged ===================== ======================= =================== user@cyber:

usbclnt -add-server 192.168.1.105:32032

$ usbclnt -list-devices ================== LIST OF REMOTE USB DEVICES =================== 1: USB server at 192.168.1.105:32032 Mode: manual-connect Status: connected | `- 8: Portable Super Multi Drive HLDS Inc Vid: 152e Pid: 2571 Port: 1-4 Mode: manual-connect Status: available for connection ===================== ======================= =================== root@localhost:

usbclnt -connect 1-8

Result. Now you can use the USB device on USB client computer just like it was plugged there directly:

Cross-platform Features and Remote Desktop Support

USB Redirector for Linux is compatible with USB Redirector, USB Redirector RDP Edition and USB Redirector TS Edition. It means you can freely share USB devices between Linux and Windows systems without any limitations.

It is possible to redirect USB devices over RDP connection from Linux thin-client to Windows Terminal Server (RD Sesssion Host). For this, you need to use one of the compatible RDP clients. We support the most popular open source Linux Remote Desktop clients, rdesktop and FreeRDP. We provide patches for these RDP clients which add USB over RDP redirection support.

After installing USB Redirector for Linux, you need to apply the special patch, that is shipped inside USB Redirector installation package in the rdp/rdesktop directory:

  1. Copy usbrdr.c and usbrdr.patch into rdesktop source code directory
  2. Run patch -p3 -i usbrdr.patch
  3. Re-compile and re-install patched rdesktop
  4. Start rdesktop with ‘-r usbrdr’ option:

./rdesktop -r usbrdr terminal.server.hostname

More Information on How to Use USB Redirector for Linux

System Requirements

USB Redirector for Linux works on the following Linux distributions:

  • Debian 6 and newer
  • Fedora 10 and newer
  • Gentoo 10.1 and newer
  • openSUSE 11.1 and newer
  • RedHat 6 and newer
  • Ubuntu 8.10 and newer
  • Other systems, which meet the following requirements:
  • kernel version 2.6.27 to 5.5
  • glibc 2.9 or newer, uclibc or musl libs
  • udev subsystem
  • r/w file system (not read-only)
  • kernel source code or kernel headers are required for installation
  • Older systems are supported with previous releases of USB Redirector, thanks to backwards-compatibility of its protocol
  • IncentivesPro is a division of SimplyCore LLC.

    Copyright © 2007-2020 SimplyCore LLC. All rights reserved.

    Источник

    Пробрасываем USB–ключ в облако (Linux клиент — Linux сервер)

    Заказчику потребовалось подключить USB–ключ для банковской системы к Linux–серверу в облаке, где он разворачивает свой разработанный продукт. Напрямую подключить USB–ключ к виртуальной машине нельзя — она работает в отказоустойчивом кластере и может быть смигрирована на любой из хост-серверов без даунтайма.

    Давайте посмотрим, как реализовать проброс USB–ключа по сети в виртуальную машину с Linux в облаке Azure Pack Infrastructure от InfoboxCloud.

    Раз подключить ключ к виртуальной машине нельзя — его нужно подключить к чему-то реальному. Есть аппаратные решения, например AnyWhere USB, но заказчик выбрал более универсальное решение: выделенный сервер в ЦОД Infobox (что для одного ключа получилось дешевле — аппаратные требования к выделенному серверу для такой задачи минимальны — можно использовать самый дешевый сервер с софтовым Raid).

    Для проброса использовалось ПО USB Redirector (версия для Linux бесплатна). На выделенный сервер и в виртуальную машину в облаке была установлена Ubuntu 16.04 LTS и были применены все обновления.

    Для установки USB Redirector потребуются исходные тексты ядра, установите их:

    Теперь необходимо отключить обновления ядра ОС, так как они могут сломать работу USB Redirector (служба проброса после обновления ядра не будет запускаться до переустановки), если необходимо — их можно устанавливать вручную переустанавливая USB Redirector.

    Установка и настройка USB Redirector на сервере с подключенным ключом USB

    Скачайте USB Redirector:

    Перейдите в папку с ним:

    Разрешите запуск инсталлятора:

    Если все прошло корректно, вы увидите сообщение об этом.

    Добавьте службу проброса в автозагрузку, если ранее этого не произошло:

    Подключив USB–ключ к выделенному серверу проверим какие USB–устройства доступны:

    Есть 2 варианта расшарить устройство по сети.

    В этом случае мы привязываемся к конкретному id устройства и порту, если включить usb-ключ в другой порт сервера — номер usb порта сменится и работать не будет.

    В этом случае мы привязываемся только к id устройства. Теперь USB–устройство расшарено по сети.

    Конечно делать его доступным для всех пользователей Интернет не правильно, поэтому добавим ограничения в firewall:

    Где вместо *.*.*.* нужно написать адрес сервера, с которого разрешено подключение.

    Установка клиента USB Redirector в облаке

    Скачайте USB Redirector:

    Перейдите в папку с ним:

    Разрешите запуск инсталлятора:

    Если все прошло корректно, вы увидите сообщение об этом.

    Добавьте службу проброса в автозагрузку, если ранее этого не произошло:

    Теперь добавим наш сервер:

    Где вместо **.**.**.** нужно указать ip–адрес сервера.

    Теперь можно посмотреть список доступных устройств:

    Видим, что на сервере 1 доступно устройство 1.

    Включаем автоматическое соединение с устройством:

    USB–ключ был успешно проброшен в виртуальную машину в облаке.

    Источник

    How to Use USB Redirector for Linux in USB Server Mode

    USB Redirector for Linux can be used in USB server or USB client modes.

    Installing USB Redirector for Linux in USB Server Mode

    To install USB Redirector for Linux in USB server mode on your computer, you should download and extract the installation package, then execute the following command:

    If you faced any problems during the installation, please read our installation troubleshooting guide.

    When installation has completed, usbsrvd daemon should be running in your system. To share or unshare USB devices use usbsrv command-line utility. All further operations are executed with the help of this utility.

    Command-line Syntax

    The generic command-line syntax of usbsrv utility is:

    where is one of the following:

    Enable or disable auto-sharing mode.

    Add specified device to exclusion list to deny manual and automatic sharing.

    Remove specified device from exclusion list.

    Create callback connection to remote USB client.

    Close callback connection to remote USB client.

    Enable or disable automatic connection of devices on the specified callback client.

    Connect the specified device to the specified client. Client must be already connected to this server.

    Disconnect the specified device from a client.

    Show a list of clients currently connected to the server.

    Show current USB server state.

    Set inactivity timeout for a USB device. Timeout value is in seconds. Set to zero to disable inactivity timeout.

    Parameters used in the commands are as follows:

    is a device ID number as displayed by -list-devices command.

    is a client ID number as displayed by -list-clients command.

    is a combination of one or more of the following parameters that identify a USB device:

    Specific device ID number as displayed by -list-devices command.

    USB device vendor ID.

    USB device product ID.

    USB device serial number.

    USB port number as displayed by -list-devices command.

    USB device name as displayed by -list-devices command. The name must be enclosed in double quotes.

    is one of the following parameters that identify a client connected to the server:

    Specific client ID number as displayed by -list-clients command.

    Remote client address and port number as displayed by -list-clients command.

    Getting a List of USB Devices

    To get a list of USB devices on your USB server, run the following command:

    If successful, this command will produce the output like this:

    $ usbsrv -list-devices =================== LIST OF LOCAL USB DEVICES =================== 1: Flash Disk — USB Mass Storage Device Vid: 0ea0 Pid: 2168 Port: 1-4 Status: plugged 16: USB-Serial Controller C Prolific Technology Inc. Vid: 067b Pid: 2303 Port: 3-1 Status: plugged, in exclusion list 18: USB Human Interface Device — Mouse Vid: 1241 Pid: 1166 Port: 2-1 Status: in use by 192.168.1.20 19: FM1083 FORTEMEDIA — Composite USB Device Vid: 138c Pid: 0001 Port: 2-2 Status: not plugged, shared ===================== ======================= =================== user@cyber:

    All USB devices in USB Redirector are assigned with unique ID numbers, these IDs help to conveniently share or unshare devices, manage settings, etc. The IDs are displayed by -list-devices command as shown above, they are located to the left of device name.

    Each USB device is displayed with the status which can take the following values:

    • plugged : USB device is plugged into the computer
    • not plugged : USB device is shared, but not currently plugged into the USB port
    • initializing : USB device is preparing for sharing, it will become shared in a moment
    • shared : USB device is shared and available for connection by clients
    • in use by : USB device is shared and connected to a remote client
    • in exclusion list : USB device is in the exclusion list and can not be shared

    Sharing a USB Device

    Before a USB device can be redirected, it must be shared. The sharing makes a device available to remote clients.

    For example, we will share the » Flash Disk — USB Mass Storage Device » that was listed by -list-devices command above. This can be done with the help of -share command:

    usbsrv -share -vid 0ea0 -pid 2168 -usb-port 1-4

    If successful, this command will display a message like this:

    $ usbsrv -share -vid 0ea0 -pid 2168 -usb-port 1-4 ====================== OPERATION SUCCESSFUL ===================== USB device has been shared ===================== ======================= =================== user@cyber:

    Please note! If you plug this device into another USB port, the port number will change and USB Redirector will treat it as another device. This is not the case for devices with serial number, such devices will be properly identified in any USB port.

    Alternatvely, it is possible to use a short form of the -share command and share the device by ID:

    If successful, this command will display a message like this:

    When USB device is shared, it will remain shared even after reboot. Shared devices are not accessible on the local system because they are acquired by USB Redirector to make them available for remote clients. To unshare a device use -unshare command.

    Unsharing a USB Device

    To unshare the » USB Human Interface Device — Mouse » listed on the screenshot above, you need to run:

    usbsrv -unshare -vid 1241 -pid 1166 -usb-port 2-1

    If successful, this command will display a message like this:

    $ usbsrv -unshare -vid 1241 -pid 1166 -usb-port 2-1 ====================== OPERATION SUCCESSFUL ===================== USB device has been unshared ===================== ======================= =================== user@cyber:

    To unshare the same device by ID, run the following command:

    usbsrv -unshare 18

    If successful, this command will display a message like this:

    Changing TCP Port Number Used By USB Redirector

    By default USB Redirector accepts incoming connections from clients on 32032 TCP port. To change the port number you can run:

    IncentivesPro is a division of SimplyCore LLC.

    Copyright © 2007-2020 SimplyCore LLC. All rights reserved.

    Источник

    Читайте также:  Windows 10 люди импорт контактов
    Оцените статью