Users

All Posts (9)

avatar

matija1

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Hello Alexis,

Thank you for the update and for taking the time to reproduce and investigate the issue.

I really appreciate your efforts and the work of the development team in identifying the root cause.

I'm glad the issue has now been confirmed and reported as a bug. I trust that a fix will be included in one of the upcoming RDM releases for Linux.

In the meantime, I will continue using native OpenSSH and look forward to your update.

Best regards,
Matija

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Hello Alexis,

Thank you for the clarification.

I ran the requested command with only my YubiKey 5C NFC connected and entered the PIV PIN interactively:

pkcs11-tool --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so --login --list-objects --type privkey

The private key object was displayed:

Private Key Object; EC
  label:      PIV AUTH key
  ID:         01
  Usage:      sign
  Access:     sensitive, always sensitive, never extractable, local

As you can see, the Access line does not contain always authenticate.

For reference, the underlying YubiKey PIV key in slot 9A was generated with PIN policy ALWAYS and touch policy ALWAYS. Native OpenSSH authentication with this key continues to work with PIN verification and physical touch.

No changes have been made to the key or its security policies.

Best regards,
Matija

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Hello Alexis,

Thank you for the update and for opening an investigation with your team.

I ran the exact command you requested, with only my YubiKey 5C NFC connected:

pkcs11-tool --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so --list-objects --type privkey

The complete output was:

Using slot 0 with a present token (0x0)

No private key objects or Access attributes were displayed.

I did not use --login or enter a PIN, as instructed.

Would you like me to perform an additional diagnostic check with PIN authentication to inspect the 9A private key attributes?

Best regards,
Matija

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

As requested, I have attached the complete Debian OpenSSH server debug log from the test on port 2222.

The log includes the full SSH connection and authentication sequence.

For privacy reasons, usernames, IP addresses, public key data, and SSH fingerprints have been redacted. All relevant diagnostic messages have been preserved.

I hope this helps with your investigation.

Best regards,
Matija

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

3. Environment Information

Here are the remaining details you requested.

Workspace:

  • Type: Local SQLite data source

  • Workspace name: Local data source

  • Database: Connections.db

  • Database schema: v1.155

  • Caching mode: In-memory

  • Devolutions Server/Cloud: Not used

RDM installation:

  • Version: 2026.3.2.1 (64-bit)

  • Installation package: .deb

  • Package name: remotedesktopmanager

  • .NET version: 10.0.14

Previous RDM version:

  • Previously installed: 2024.3.1.3

  • Upgraded directly to: 2026.3.2.1

  • I did not perform a confirmed successful YubiKey PIV/PKCS#11 SSH authentication test with the older version, so I cannot confirm whether this is a regression.

Client:

  • Ubuntu 24.04 LTS (GNOME, amd64)

  • OpenSSH client: 9.6p1

  • OpenSC: 0.25.0~rc1-1ubuntu0.2

  • PKCS#11 library: /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

SSH server:

  • Debian 12

  • OpenSSH server: 9.2p1

  • Normal SSH port: 22

  • Debug SSH port: 2222

YubiKey:

  • Model: YubiKey 5C NFC

  • Firmware: 5.7.4

  • PIV slot: 9A

  • Algorithm: ECC P-256

  • PIN policy: ALWAYS

  • Touch policy: ALWAYS

  • Private key generated on the device and non-exportable.

Native OpenSSH authentication with this same YubiKey and OpenSC library continues to work successfully, requiring both the PIV PIN and physical touch.

No changes were made to the PIV key or its security policies during testing.

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Continuing with the anonymized Debian SSH debug output.

These are the relevant authentication messages from the original server log:

debug1: userauth-request for user <SSH_USER> service ssh-connection method publickey [preauth]

debug1: userauth_pubkey: publickey test pkalg ecdsa-sha2-nistp256 pkblob ECDSA SHA256:<REDACTED_YUBIKEY_PIV> [preauth]

debug1: /home/<SSH_USER>/.ssh/authorized_keys:1: matching key found: ECDSA SHA256:<REDACTED_YUBIKEY_PIV>

Accepted key ECDSA SHA256:<REDACTED_YUBIKEY_PIV> found at /home/<SSH_USER>/.ssh/authorized_keys:1

debug3: mm_answer_keyallowed: publickey authentication test: ECDSA key is allowed

debug3: send packet: type 60 [preauth]

debug2: userauth_pubkey: authenticated 0 pkalg ecdsa-sha2-nistp256 [preauth]

Postponed publickey for <SSH_USER> from <CLIENT_IP> port <CLIENT_EPHEMERAL_PORT> ssh2 [preauth]

Connection closed by authenticating user <SSH_USER> <CLIENT_IP> port <CLIENT_EPHEMERAL_PORT> [preauth]

All fingerprints and identifying information have been redacted.

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

2. Debian SSH Server Debug Results

I started a separate SSH daemon using:

sudo /usr/sbin/sshd -ddd -p 2222

The normal SSH service on port 22 remained unchanged.

RDM requested the PIV PIN and then disconnected as before.

The Debian debug log contains these messages:

  • Remote software version: Devolutions1.0

  • KEX done

  • Public key algorithm: ecdsa-sha2-nistp256

  • Matching key found in authorized_keys

  • Public key authentication test: ECDSA key is allowed

  • Postponed publickey

  • Connection closed by authenticating user

All fingerprints and identifying information have been removed.

I will provide the complete anonymized debug output separately.

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Hello Alexis,

Thank you for your detailed instructions.

I have completed the requested diagnostic tests, including the RDM session log and the Debian OpenSSH debug test on port 2222.

I will share the results in separate replies to keep the diagnostic output manageable.

1. RDM Session Log

Logging settings:

  • Enable logging: Enabled

  • Log path type: Custom

  • Log path: /home/<LOCAL_USER>/rdm-ssh-piv-debug.log

  • Log mode: Event

  • Verbose: 4

  • Log into terminal: Disabled

After saving these settings, I performed one connection attempt.

RDM requested the PIV PIN. After entering it, the session closed and RDM returned to the Overview. The YubiKey LED remained illuminated briefly, and touching it did not restore the connection.

The resulting log file was 153 bytes and contained:

[11/10/2026 5:27:52 PM] Devolutions.ProtocolsSharp: 2026.9.28.2 OS: Linux
[11/10/2026 5:27:52 PM] SSH session: Failed to initiate PKCS11 ECDSA signing

No PIN, password, or private key material was present in the log.

I will provide the anonymized SSH server debug output and environment details in the following replies.

Best regards,
Matija

RDM 2026.3.2.1 Linux – YubiKey PIV PKCS#11 SSH disconnects after PIN, before touch confirmation

avatar
avatar
avatar

Hello Devolutions Team,

I would like to report a reproducible issue with YubiKey PIV authentication over SSH in Remote Desktop Manager for Linux.

The same YubiKey, PKCS#11 module, private key, and SSH server work correctly with native OpenSSH on Ubuntu. However, RDM terminates the connection immediately after entering the PIV PIN, while the YubiKey is still waiting for physical touch confirmation.

I have performed extensive testing to isolate the problem.

1. Environment

Client:

  • Operating system: Ubuntu 24.04 LTS

  • Architecture: x86_64

  • Desktop environment: GNOME

  • Display server: X11

  • Remote Desktop Manager: 2026.3.2.1 (64-bit)

  • OpenSSH: 9.6p1

  • OpenSC: 0.25.0~rc1-1ubuntu0.2

  • PKCS#11 library: /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

  • YubiKey Manager CLI: 5.2.1

Hardware security key:

  • Model: YubiKey 5C NFC

  • Firmware: 5.7.4

  • Application: PIV

  • PIV slot: 9A (PIV Authentication)

  • Algorithm: ECC P-256

  • Key generated directly on the YubiKey

  • PIN policy: ALWAYS

  • Touch policy: ALWAYS

  • Self-signed X.509 certificate: CN=YubiKey-SSH

  • Private key: Hardware-resident and non-exportable

SSH server:

  • Debian Linux virtual machine on a local network

  • OpenSSH server

  • Public-key authentication enabled

  • Password authentication enabled

  • AuthenticationMethods any

  • YubiKey public key installed in the user's ~/.ssh/authorized_keys

The SSH server is functioning correctly and accepts the YubiKey public key when using native OpenSSH.

2. OpenSC and PKCS#11 verification — SUCCESSFUL

OpenSC detects the YubiKey correctly.

Command:

pkcs11-tool \
  --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so \
  --list-slots

Relevant output:

Slot 0: Yubico YubiKey OTP+FIDO+CCID
token label: YubiKey-SSH
token flags: login required, rng, token initialized, PIN initialized

The PIV authentication certificate is visible:

pkcs11-tool \
  --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so \
  --list-objects \
  --type cert

Output:

Certificate Object; type = X.509 cert
label: Certificate for PIV Authentication
subject: DN: CN=YubiKey-SSH
ID: 01

After entering the PIV PIN, OpenSC also detects the private key object:

pkcs11-tool \
  --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so \
  --login \
  --list-objects \
  --type privkey

Output:

Private Key Object; EC
label: PIV AUTH key
ID: 01
Usage: sign
Access: sensitive, always sensitive, never extractable, local

This confirms that the existing PIV private key is available for signing operations through PKCS#11 without exporting private key material.

3. Independent ECDSA signing test — SUCCESSFUL

I performed a direct PKCS#11 ECDSA signing test using the existing key in PIV slot 9A.

The operation required:

  1. Entering the PIV PIN.

  2. Physically touching the YubiKey.

The operation successfully produced a 64-byte raw ECDSA signature.

After converting the signature to ASN.1 DER format, I verified it using OpenSSL and the corresponding public key.

Command:

openssl pkeyutl -verify \
  -pubin \
  -inkey "$HOME/yubikey_ssh_9a_public.pem" \
  -sigfile "$HOME/yubikey_piv_test/signature.der" \
  -in "$HOME/yubikey_piv_test/digest.bin"

Result:

Signature Verified Successfully

Therefore, ECDSA signing through OpenSC works correctly with the hardware-protected key, including PIN and touch enforcement.

4. Native OpenSSH authentication — SUCCESSFUL

The same YubiKey successfully authenticates to the Debian SSH server using the native Ubuntu OpenSSH client.

Command:

ssh \
  -o PKCS11Provider=/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so \
  -o PreferredAuthentications=publickey \
  -o PasswordAuthentication=no \
  -o KbdInteractiveAuthentication=no \
  <SSH_USER>@<DEBIAN_TEST_VM>

Observed behavior:

  1. OpenSSH requests the YubiKey PIV PIN.

  2. I enter the PIN.

  3. The YubiKey indicates that physical touch is required.

  4. I touch the YubiKey.

  5. Public-key authentication succeeds.

  6. The Debian SSH shell opens normally.

I have successfully repeated this test multiple times.

Password and keyboard-interactive authentication are explicitly disabled for these tests, so the successful connection cannot be attributed to password fallback.

The Debian SSH logs confirm successful public-key authentication:

Accepted publickey for <SSH_USER> from <CLIENT_IP>
ssh2: ECDSA SHA256:<REDACTED_PUBLIC_KEY_FINGERPRINT>

Followed by:

pam_unix(sshd:session): session opened for user <SSH_USER>

Native OpenSSH authentication works reliably with this exact YubiKey and PKCS#11 module.

5. Remote Desktop Manager configuration

I created a separate SSH Shell test connection in RDM.

Configuration:

Connection type: SSH Shell
Host: <DEBIAN_TEST_VM>
Username: <SSH_USER>
Password: Empty
Use smart card: Enabled
Certificate method: PKCS
PIN code: Empty
SSH key → Private key: No private key
Algorithm support: Default
Use SSH authentication agent: Disabled
Display error messages: Default (Yes)

The PIN field is intentionally empty because I do not want to store the security key's PIN in the application.

In the RDM application settings, the Smart Card PKCS library is configured as:

/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

I verified that the RDM process actually loads this library:

sudo lsof -nP | grep -F 'opensc-pkcs11.so'

Relevant output:

RemoteDes ... <LOCAL_USER> ... /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so

Therefore, RDM loads the correct OpenSC PKCS#11 library.

I also disconnected my second hardware security key during testing, leaving only the YubiKey 5C NFC available to OpenSC.

6. RDM SSH authentication — FAILURE

Steps to reproduce:

  1. Connect the YubiKey 5C NFC.

  2. Start Remote Desktop Manager 2026.3.2.1 on Ubuntu 24.04.

  3. Open the SSH Shell test connection.

  4. RDM displays a PIV PIN prompt.

  5. Enter the correct PIV PIN.

Actual behavior:

Immediately after entering the PIN:

  • The PIN prompt disappears.

  • RDM terminates the SSH connection attempt.

  • The interface returns to the connection's Overview screen.

  • No terminal session opens.

  • No visible error message is displayed.

  • The YubiKey remains illuminated, apparently waiting for physical touch confirmation.

  • Touching the YubiKey turns off the light, but RDM does not resume the connection.

This behavior is reproducible.

The key observation is that RDM abandons the SSH connection while the YubiKey is still indicating that physical interaction is required.

The YubiKey does not show exactly the same LED behavior as during a successful native OpenSSH authentication.

I understand that the LED behavior alone does not prove the cause, but the disconnect timing is consistent.

7. Debian SSH server logs during failed RDM authentication

I monitored the SSH server logs during a single controlled RDM connection attempt:

sudo journalctl -u ssh -f -o short-iso

The server recorded:

sshd[<PID>]: Connection closed by authenticating user <SSH_USER> <CLIENT_IP> port <PORT> [preauth]

There was no corresponding Accepted publickey message for that controlled RDM attempt.

The connection therefore ended before SSH authentication completed.

By contrast, native OpenSSH attempts produce successful Accepted publickey events followed by the opening of a user session.

8. Troubleshooting already performed

Connection logging

I enabled:

Enable logging: Yes
Log path type: Custom
Log mode: Event
Verbose: 4
Log into terminal: No

The custom log file was not created during the failed authentication attempts.

Launching RDM from an Ubuntu terminal

I started RDM using:

remotedesktopmanager 2>&1 | tee "$HOME/rdm-piv-console.log"

The output file was created successfully but remained empty after reproducing the issue.

RDM Application logs

I opened:

Help → Application logs

I enabled all available log types:

  • Error

  • Error silent

  • Info

Only informational messages relating to a local database upgrade were displayed.

There were no relevant SSH, PKCS#11, ECDSA, or smart-card authentication errors.

RDM System diagnostics

I checked:

Help → System diagnostics

Relevant information:

Ubuntu 24.04
Architecture: X64
Desktop environment: GNOME
Display server: X11
Container: None
Debug level: 1

The report did not identify the SSH authentication failure.

SSH algorithm configuration

I inspected RDM's Algorithm support settings.

The available categories were:

  • Cipher

  • Host key

  • Kex

  • MAC

ECDSA SHA2 NIST P-256 is available in the host-key algorithm list.

I left Algorithm support set to Default because host-key algorithms are distinct from client public-key authentication algorithms.

9. Expected behavior

I expect RDM to:

  1. Load the configured OpenSC PKCS#11 module.

  2. Use the existing ECC P-256 PIV Authentication key in slot 9A.

  3. Request the PIV PIN.

  4. Wait for physical touch confirmation without terminating the SSH connection.

  5. Complete ECDSA signing using the private key on the YubiKey.

  6. Complete SSH public-key authentication.

  7. Open the SSH terminal session.

This exact authentication flow works with native OpenSSH.

10. Questions for the Devolutions development team

Could you please clarify the following?

1. Is SSH authentication using YubiKey PIV through OpenSC PKCS#11 officially supported in Remote Desktop Manager 2026.3.2.1 for Linux?

2. Does this implementation support ECC P-256 PIV keys configured with both PIN ALWAYS and TOUCH ALWAYS?

3. Is there a known issue where the SSH connection closes immediately after entering the PIV PIN while the hardware token is still waiting for physical touch?

4. Could the behavior be related to the handling of blocking PKCS#11 signing operations, touch confirmation, a timeout, or an asynchronous signing issue?

5. Is CKM_ECDSA signing through OpenSC supported in this SSH authentication scenario?

6. Is the following configuration correct for a hardware-resident PIV key?

Use smart card: Enabled
Certificate method: PKCS
Private key: No private key
PIN code: Empty

7. Can RDM on Linux use native OpenSSH or an external OpenSSH SSH agent for PKCS#11-backed SSH authentication instead of its internal smart-card implementation?

8. How can detailed SSH authentication and PKCS#11 signing diagnostics be enabled in the Linux application?

9. Is this a known issue, and is there a fix, workaround, or newer build that addresses it?

I would strongly prefer a solution that preserves the existing security policies:

PIN ALWAYS
TOUCH ALWAYS

I do not want to export or locally store the private key or weaken the hardware authentication requirements.

11. Summary

WORKING:

Ubuntu OpenSSH
    → OpenSC PKCS#11
    → YubiKey 5C NFC / PIV 9A
    → PIV PIN
    → Physical touch
    → ECC P-256 ECDSA signature
    → Successful Debian SSH authentication

FAILING:

Remote Desktop Manager 2026.3.2.1
    → OpenSC PKCS#11 library loaded
    → YubiKey PIV PIN requested
    → Correct PIN entered
    → SSH connection immediately closes
    → YubiKey remains illuminated awaiting touch
    → SSH authentication does not complete

Because the same hardware token, private key, PKCS#11 module, and SSH server work successfully through native OpenSSH, I suspect an issue in RDM's Linux SSH/PKCS#11 authentication flow.

I would appreciate confirmation of the supported configuration and guidance on diagnosing or resolving this behavior.

Thank you for your assistance.

1 - 9 of 9 items