NuSkooler / enigma-bbs

ENiGMA½ BBS Software
https://nuskooler.github.io/enigma-bbs/
BSD 2-Clause "Simplified" License
529 stars 104 forks source link

SSH key generation error in docs #499

Closed cognitivegears closed 9 months ago

cognitivegears commented 10 months ago

Describe the Bug The ssh key generation documentation has gotten a little out of date. ssh-keygen no longer defaults to outputting RSA, but our version of ssh2 doesn't support newer algorithms. Also, the docs in config.hjson is even older and also needs updating. We should update the docs and look at updating ssh2 as well.

To Reproduce Follow the docs to run ssh-keygen.

Expected Behavior Enigma starts normally.

Actual Behavior

xavious@toejam:~/enigma-bbs$ ./main.js
Error initializing: Error: Cannot parse privateKey: Unsupported key format
    at new Server (/home/xavious/enigma-bbs/node_modules/ssh2/lib/server.js:247:15)
    at SSHServerModule.createServer (/home/xavious/enigma-bbs/core/servers/login/ssh.js:396:23)
    at /home/xavious/enigma-bbs/core/listening_server.js:39:36
    at /home/xavious/enigma-bbs/core/module_util.js:120:28
    at loaded (/home/xavious/enigma-bbs/core/module_util.js:93:20)
    at loadModuleEx (/home/xavious/enigma-bbs/core/module_util.js:76:12)
    at loadModule (/home/xavious/enigma-bbs/core/module_util.js:90:5)
    at /home/xavious/enigma-bbs/core/module_util.js:111:17
    at /home/xavious/enigma-bbs/node_modules/async/dist/async.js:2588:44
    at eachOfArrayLike (/home/xavious/enigma-bbs/node_modules/async/dist/async.js:506:13)
Error initializing: Error: Cannot parse privateKey: Unsupported key format
    at new Server (/home/xavious/enigma-bbs/node_modules/ssh2/lib/server.js:247:15)
    at SSHServerModule.createServer (/home/xavious/enigma-bbs/core/servers/login/ssh.js:396:23)
    at /home/xavious/enigma-bbs/core/listening_server.js:39:36
    at /home/xavious/enigma-bbs/core/module_util.js:120:28
    at loaded (/home/xavious/enigma-bbs/core/module_util.js:93:20)
    at loadModuleEx (/home/xavious/enigma-bbs/core/module_util.js:76:12)
    at loadModule (/home/xavious/enigma-bbs/core/module_util.js:90:5)
    at /home/xavious/enigma-bbs/core/module_util.js:111:17
    at /home/xavious/enigma-bbs/node_modules/async/dist/async.js:2588:44
    at eachOfArrayLike (/home/xavious/enigma-bbs/node_modules/async/dist/async.js:506:13)
xavious@toejam:~/enigma-bbs$

Environment N/A

NuSkooler commented 10 months ago

Related https://github.com/NuSkooler/enigma-bbs/issues/399

shawnyeager commented 10 months ago

Is there a quick fix for this by way of a parameter passed to openssl?

cognitivegears commented 9 months ago

Is there a quick fix for this by way of a parameter passed to openssl?

Yes - you can just pass -t rsa to openssl to generate a RSA key.

cognitivegears commented 9 months ago

The documentation has been updated, as well as an update to the ssh2 library in PR #515. The updated ssh2 does support ECDSA, however we still don't want to use it (in most cases) because some old ssh clients like Netrunner don't like it still.

cognitivegears commented 9 months ago

Closing this issue as completed.