Подключение по RDP с Windows на Linux с пробросом Rutoken ECP

Здравствуйте.

Есть задача подключаться с Windows на Linux Debian 11.6 с использованием Рутокена ECP.
Токен был инициализирован через панель управления Рутокен Windows. Сертификат сгенерирован средстами на стороне Windows.
На Debian установлен XRDP, XORGXRDP

xorgxrdp/stable,now 1:0.2.12-1 amd64 [installed,automatic]
xrdp/stable,now 0.9.12-1.1 amd64 [residual-config]

Обе машины находятся в домене. Авторизация по PAM. PAM настроил, но есть сомнение что правильно в части использования токена.
Авторизация проходит успешно по логину и паролю.
Но Debian упорно не хочет видеть Рутокен.

root@testtslinux:~# pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader... \

В /etc/pam.d/common-auth вписал строку

auth    [success=1 default=ignore]      pam_pkcs11.so

В /etc/pam_pkcs11/pam_pkcs11.conf настроил конфиг для работы с токеном:


...
use_pkcs11_module = rutokenecp;
...
 pkcs11_module rutokenecp {
    module = /usr/lib/librtpkcs11ecp.so;
    description = "RuToken pkcs#11 module";
    slot_num = 0;
    support_threads = false;
    ca_dir = /etc/pam_pkcs11/cacerts;
    crl_dir = /etc/pam_pkcs11/crls;
    cert_policy = signature, ca, oscp_on;
}

В /etc/pam_pkcs11/cacerts положил сертификат ЦС домена.

Когда подключаюсь по RDP к Debian в логах XRDP вижу ошибки, но сказать наверняка, что это связано с тем, что рутокен не виден, не могу.

[ERROR] xrdp_sec_recv: xrdp_mcs_recv failed
[20230530-05:30:15] [ERROR] xrdp_rdp_recv: xrdp_sec_recv failed
[20230530-05:30:15] [ERROR] libxrdp_process_data: xrdp_rdp_recv failed
[20230530-05:30:15] [ERROR] xrdp_process_data_in: xrdp_process_loop failed
[20230530-05:30:15] [ERROR] SSL_write: I/O error
[20230530-05:30:15] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20230530-05:30:15] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20230530-05:30:16] [INFO ] Socket 12: AF_INET connection received from 192.168.13.236 port 57550
[20230530-05:30:16] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20230530-05:30:16] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20230530-05:30:16] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20230530-05:30:16] [ERROR] SSL_read: I/O error
[20230530-05:30:16] [ERROR] libxrdp_force_read: header read error
[20230530-05:30:16] [ERROR] Processing [ITU-T T.125] Connect-Initial failed
[20230530-05:30:16] [ERROR] [MCS Connection Sequence] receive connection request failed
[20230530-05:30:16] [ERROR] xrdp_sec_incoming: xrdp_mcs_incoming failed
[20230530-05:30:16] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed
[20230530-05:30:16] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed
[20230530-05:30:16] [INFO ] Socket 12: AF_INET connection received from 192.168.0.1 port 57552
[20230530-05:30:16] [ERROR] xrdp_iso_send: trans_write_copy_s failed
[20230530-05:30:16] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20230530-05:30:16] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed
[20230530-05:30:16] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20230530-05:30:16] [INFO ] Security protocol: configured [SSL|RDP], requested [SSL|HYBRID|HYBRID_EX|RDP], selected [SSL]
[20230530-05:30:16] [INFO ] Connected client computer name: COMP
[20230530-05:30:16] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc006 is unknown (ignored)
[20230530-05:30:16] [WARN ] Received [MS-RDPBCGR] TS_UD_HEADER type 0xc00a is unknown (ignored)
[20230530-05:30:16] [INFO ] xrdp_load_keyboard_layout: Keyboard information sent by the RDP client, keyboard_type:[0x04], keyboard_subtype:[0x00], keylayout:[0x00000409]
[20230530-05:30:16] [INFO ] xrdp_load_keyboard_layout: model [] variant [] layout [us] options []
[20230530-05:30:16] [INFO ] TLS connection established from 192.168.0.1 port 57552: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20230530-05:30:16] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20230530-05:30:16] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 10485760 MB cache entries 100
[20230530-05:30:16] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20230530-05:30:16] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20230530-05:30:16] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[20230530-05:30:16] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20230530-05:30:16] [WARN ] local keymap file for 0x00000409 found and doesn't match built in keymap, using local keymap file
[20230530-05:30:27] [INFO ] connecting to sesman on 127.0.0.1:3350
[20230530-05:30:27] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20230530-05:30:27] [INFO ] sesman connect ok
[20230530-05:30:27] [INFO ] sending login info to session manager. Please wait...
[20230530-05:30:29] [INFO ] xrdp_wm_log_msg: login failed for user user
[20230530-05:30:29] [INFO ] login failed for user user 

xrdp-sesman.log

[20230530-05:07:06] [ERROR] sesman_data_in: scp_process_msg failed
[20230530-05:07:06] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans
[20230530-05:30:27] [INFO ] Socket 12: AF_INET connection received from 127.0.0.1 port 33210
[b][20230530-05:30:27] [INFO ] PAM: Smartcard authentication starts[/b]
[b][20230530-05:30:27] [ERROR] PAM: Error 2306: No suitable token available[/b]
[b][20230530-05:30:29] [ERROR] pam_authenticate failed: Authentication failure[/b]
[20230530-05:30:29] [INFO ] AUTHFAIL: user=user ip=192.168.0.1 time=1685439029
[20230530-05:30:29] [ERROR] sesman_data_in: scp_process_msg failed
[20230530-05:30:29] [ERROR] sesman_main_loop: trans_check_wait_objs failed, removing trans

На Windows стоят драйвера версии 4.16.0.0.

На Debian установлены следующие пакеты:

libccid/stable,now 1.4.34-1 amd64 [installed]
libpcsclite1/stable,now 1.9.1-1 amd64 [installed,automatic]
pcscd/stable,now 1.9.1-1 amd64 [installed]
pcsc-tools/stable,now 1.5.7-1 amd64 [installed]
opensc/stable,now 0.21.0-1 amd64 [installed]

На портале документации не нашёл упоминаний настройки такого подключения, это вообще реально? Кто-то сталкивался с подобным подключением?
При этом с Linux на Windows подключается без проблем.
Из этой темы https://dev.rutoken.ru/pages/viewpage.a … Id=3440696 скачал PDF и настроил pam_pkcs11.conf.

Re: Подключение по RDP с Windows на Linux с пробросом Rutoken ECP

Turtle, добрый день.
Возможно, поможет инструкция https://www.altlinux.org/Xrdp-usb

Re: Подключение по RDP с Windows на Linux с пробросом Rutoken ECP

Аверченко Кирилл, к сожалению пакета xrdp-usb-session для Debian нет. Я так понял, это ребята разработчики написали два пакета для ALT Linux - xrdp-usb-session и xrdp-usb-terminal

Re: Подключение по RDP с Windows на Linux с пробросом Rutoken ECP

Turtle, в таком случае можно попробовать использовать какие-либо варианты реализации usb over IP, доступные в Debian.
Насколько нам известно, сам XORGXRDP пробрасывать устройства не умеет.