[GH-ISSUE #887] Amnezia VPN client fails to connect to the server with an RSA 3072 key #238

Open
opened 2026-10-13 20:16:28 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @rominf on GitHub (Jul 8, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/887

Describe the bug
The AmneziaVPN client fails to connect to the server with an RSA 3072 key. The GUI displays ErrorCode: 101. Internal error, and in the console failed to export private key is printed.

To Reproduce
Steps to reproduce the behavior:

  1. Generate RSA 3072 key using ssh-keygen -t rsa command (in my tests, the passphrase length or its absence does not matter).
  2. Set up a server in the cloud with the key from previous step added for the root user .
  3. Ensure ssh can connect to the server from the PC.
  4. Install AmneziaVPN on the PC.
  5. Launch AmneziaVPN.
  6. Click the "+" icon.
  7. Click "Configure your server".
  8. Fill in the IP-address, SSH username (root), and enter the RSA 3072 SSH private key (same as in step (1)).
  9. Click "Continue".
  10. (Optional, see (1)) Enter passphrase.
  11. (Optional, see previous step) Click "Save".
  12. Observe errors in the GUI, console, and logs.

Expected behavior
The AmneziaVPN client connects to the server.

Log files

2024-07-08 16:23:48 info Logging has enabled on AmneziaVPN version 4.5.3.0 eb48e4b
2024-07-08 16:23:48 info Fedora Linux 40 (KDE Plasma) (x86_64)
2024-07-08 16:24:24 debug QML onClosing signal
2024-07-08 16:24:30 info Started AmneziaVPN version 4.5.3.0 eb48e4b
2024-07-08 16:24:30 info Fedora Linux 40 (KDE Plasma) (x86_64)
2024-07-08 16:25:23 debug failed to export private key

Screenshots
(IP address is removed using a graphics editor)

Screenshot_20240708_161538

Desktop (please complete the following information):

  • OS: Fedora 40
  • Version: 4.5.3.0

Smartphone (please complete the following information):

  • Device: irrelevant
  • OS: irrelevant
  • Version: irrelevant

Server (please complete the following information):

  • OS: Ubuntu 22.04

Additional context
I found that the length of the SSH key passphrase or its absence does not matter. Adding an ED25519 key to the server and entering it into AmneziaVPN results in expected connection.

Originally created by @rominf on GitHub (Jul 8, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/887 **Describe the bug** The AmneziaVPN client fails to connect to the server with an RSA 3072 key. The GUI displays `ErrorCode: 101. Internal error`, and in the console `failed to export private key` is printed. **To Reproduce** Steps to reproduce the behavior: 1. Generate RSA 3072 key using `ssh-keygen -t rsa` command (in my tests, the passphrase length or its absence does not matter). 2. Set up a server in the cloud with the key from previous step added for the `root` user . 3. Ensure `ssh` can connect to the server from the PC. 4. Install AmneziaVPN on the PC. 5. Launch AmneziaVPN. 6. Click the "+" icon. 7. Click "Configure your server". 8. Fill in the IP-address, SSH username (`root`), and enter the RSA 3072 SSH private key (same as in step (1)). 9. Click "Continue". 10. (Optional, see (1)) Enter passphrase. 11. (Optional, see previous step) Click "Save". 12. Observe errors in the GUI, console, and logs. **Expected behavior** The AmneziaVPN client connects to the server. **Log files** ``` 2024-07-08 16:23:48 info Logging has enabled on AmneziaVPN version 4.5.3.0 eb48e4b 2024-07-08 16:23:48 info Fedora Linux 40 (KDE Plasma) (x86_64) 2024-07-08 16:24:24 debug QML onClosing signal 2024-07-08 16:24:30 info Started AmneziaVPN version 4.5.3.0 eb48e4b 2024-07-08 16:24:30 info Fedora Linux 40 (KDE Plasma) (x86_64) 2024-07-08 16:25:23 debug failed to export private key ``` **Screenshots** (IP address is removed using a graphics editor) ![Screenshot_20240708_161538](https://github.com/amnezia-vpn/amnezia-client/assets/3449635/d855a2f0-8cc2-4a41-a7cf-a92f44b1c119) **Desktop (please complete the following information):** - OS: Fedora 40 - Version: 4.5.3.0 **Smartphone (please complete the following information):** - Device: irrelevant - OS: irrelevant - Version: irrelevant **Server (please complete the following information):** - OS: Ubuntu 22.04 **Additional context** I found that the length of the SSH key passphrase or its absence does not matter. Adding an ED25519 key to the server and entering it into AmneziaVPN results in expected connection.
Author
Owner

@jinnko commented on GitHub (Jul 24, 2024):

Same issue with RSA key.

With ed25519 key rather than an error the UI just hangs after hitting save on the "Private key passphrase" input.

<!-- gh-comment-id:2248882028 --> @jinnko commented on GitHub (Jul 24, 2024): Same issue with RSA key. With ed25519 key rather than an error the UI just hangs after hitting save on the "Private key passphrase" input.
Author
Owner

@MaximBobylev commented on GitHub (Aug 23, 2024):

same problem on mac os sonoma - 4096 bit rsa failed, so i had to

 ssh-keygen -t ed25519 -C "{my_email}"
 ssh-copy-id {my_server}

And then used .ssh/id_ed25519 for connection

<!-- gh-comment-id:2306446676 --> @MaximBobylev commented on GitHub (Aug 23, 2024): same problem on mac os sonoma - 4096 bit rsa failed, so i had to ```bash ssh-keygen -t ed25519 -C "{my_email}" ssh-copy-id {my_server} ``` And then used `.ssh/id_ed25519` for connection
Author
Owner

@MayMih commented on GitHub (Nov 26, 2024):

The same problem on Windows 11 24H2:

There are only two lines in the log (when logging in by key)

2024-11-26 17:35:40 debug IpcClient::init succeed
2024-11-26 17:36:40 debug failed to export private key

AmneziaVPN Software Version : 4.8.2.3 (Oct 25 2024, 9e71e64c)

On version 4.8.1.9, the result is the same.

Request to authors: "is it possible to add the ability to open a private key from a file, and not through the clipboard?"

UPD: @rominf I managed to get rid of this error with the help of Putty:

  1. Load your private key into puttygen.exe
  2. Click menu item "Convertions" -> "Export OpenSSH key" (do NOT use "force new file format" item)
  3. Copy resulted file content to the clipboard and paste into AmneziaVPN client
  4. Connection established successefully.
    image

UPD: On the latest Amnezia 4.8.7.2 the behavior is still the same. It's a pity. Looks like this bug will not be fixed.

<!-- gh-comment-id:2501034680 --> @MayMih commented on GitHub (Nov 26, 2024): The same problem on Windows 11 24H2: There are only two lines in the log (when logging in by key) > 2024-11-26 17:35:40 debug IpcClient::init succeed > 2024-11-26 17:36:40 debug failed to export private key AmneziaVPN Software Version : 4.8.2.3 (Oct 25 2024, 9e71e64c) On version 4.8.1.9, the result is the same. Request to authors: "is it possible to add the ability to open a private key from a file, and not through the clipboard?" UPD: @rominf I managed to get rid of this error with the help of [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html): 1. Load your private key into puttygen.exe 2. Click menu item "Convertions" -> "Export OpenSSH key" (do NOT use "force new file format" item) 3. Copy resulted file content to the clipboard and paste into AmneziaVPN client 4. Connection established successefully. ![image](https://github.com/user-attachments/assets/127c3a94-3aeb-4252-9b1d-ae0810e64d9b) **UPD:** On the latest Amnezia 4.8.7.2 the behavior is still the same. It's a pity. Looks like this bug will not be fixed.
Author
Owner

@tiaga commented on GitHub (Mar 14, 2025):

As it was discussed previously, Amnezia supports RSA keys only in PEM format and ed25519 keys: https://github.com/amnezia-vpn/amnezia-client/issues/1375#issuecomment-2666154186.

But you can always convert your OpenSSH key to required format:

puttygen your-openssh-private-key.txt -O private-openssh -o converted_rsa_key.txt

@Nethius it would be nice if OpenSSH keys support will be added to Amnezia in future releases.

<!-- gh-comment-id:2725230392 --> @tiaga commented on GitHub (Mar 14, 2025): As it was discussed previously, Amnezia supports RSA keys only in PEM format and ed25519 keys: https://github.com/amnezia-vpn/amnezia-client/issues/1375#issuecomment-2666154186. But you can always convert your OpenSSH key to required format: ``` puttygen your-openssh-private-key.txt -O private-openssh -o converted_rsa_key.txt ``` @Nethius it would be nice if OpenSSH keys support will be added to Amnezia in future releases.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#238
No description provided.