Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing #563 (Cannot parse privateKey: Unsupported key format) #566

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/_docs/troubleshooting/ssh-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,25 @@ Several things can cause this:
1. `ssh_private_key.pem` was installed to the wrong location. Make sure that it is in the `config/security` directory and has the name matching the error message. You can also change your `config.hjson` if you prefer to point to the location of the key file.
2. `ssh_private_key.pem` has the wrong file permissions. Verify that the file will be readable by the user that the BBS is running as. Because it is a cryptographic key however, we do recommend that access is restricted only to that user.

## Error With Netrunner
## Cannot parse privateKey: Unsupported key format

***Symptom:***
BBS not starting with an error similar to the following:

```shell
Error initializing: Error: Cannot parse privateKey: Unsupported key format
```

***Solution:***
Depending on the OpenSSL version, a specific key format is used to generate the private key. The error above is observed on Debian 12 (Bookworm), but might present itself on other Debian 12 derivatives.

Convert the unsupported key to a supported one:

```shell
openssl rsa -in unsupported.key -out converted.key -traditional
```

## Errors With Netrunner

***Symptom:***
Some ssh clients connect, but Netrunner (and other older clients) get a connection failed message and the following is in the log:
Expand Down
8 changes: 8 additions & 0 deletions misc/config_template.in.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,15 @@
//
// 3 - Finally, set 'enabled' to 'true'
//
// ! - If you receive the following error when starting ENiGMA:
// "Error initializing: Error: Cannot parse privateKey: Unsupported key format"
// You might need to convert your key. This can be done as follows:
//
// > openssl rsa -in unsupported.key -out converted.key -traditional
//
//
// Additional reading:
// - https://nuskooler.github.io/enigma-bbs/troubleshooting/ssh-troubleshooting.html
// - https://blog.sleeplessbeastie.eu/2017/12/28/how-to-generate-private-key/
// - https://gist.github.com/briansmith/2ee42439923d8e65a266994d0f70180b
//
Expand Down
Loading