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

预设的 Private Key 应该怎么填 #18

Closed
loveqianool opened this issue Feb 19, 2020 · 3 comments
Closed

预设的 Private Key 应该怎么填 #18

loveqianool opened this issue Feb 19, 2020 · 3 comments

Comments

@loveqianool
Copy link

@loveqianool loveqianool commented Feb 19, 2020

docker 加载配置文件 Private Key 我直接复制粘贴报以下错误

 Copyright (C) Rui NI <nirui@gmx.com>
 https://github.com/niruix/sshwifty

[INF] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty: Initializing
[INF] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty > Configuration > Redundant: Loading configuration from: /sshwifty.conf.json
[WRN] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty > Configuration > Redundant: Unable to load configuration from "File": invalid character '\n' in string literal
[ERR] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty: "Redundant" loader cannot load configuration: All existing redundant loader has failed
[ERR] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty: Unable to start due to error: All existing redundant loader has failed
[INF] Wed, 19 Feb 2020 17:59:10 UTC Sshwifty: Closed

我把 key 的换行全部删掉倒是能启动成功了,但是连接的时候找不到 key 。

Connection failed
ssh: handshake failed: ssh: no key found
@niruix

This comment has been minimized.

Copy link
Owner

@niruix niruix commented Feb 20, 2020

不知道你的具体配置是什么样的,正确的值应该类似于:

"-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAs1vnAk.....\n-----END RSA PRIVATE KEY-----"

也就是你把私钥文件一行一行粘贴到Sshwifty的配置文件里,然后用\n来替代换行。

注意:目前sshwifty.conf.example.json里的--------- BEGIN RSA PRIVATE KEY ---------其实是不正确的私钥头,正确的应该是-----BEGIN RSA PRIVATE KEY-----(或者你真实私钥的私钥头)。

另外还要注意的是,“预设”功能其实只是一种表单自动填充辅助你在其中指定的值都会被发送给客户端,包括私钥,以便客户端自动填写连接向导的表单。请自行评估这样做的安全性 :)

@loveqianool

This comment has been minimized.

Copy link
Author

@loveqianool loveqianool commented Feb 20, 2020

好的,如你所说的用 \n 替代换行后,成功启动并连接成功了。
我觉得这个应该写进文档,这样如我们这些小白用户才知道怎么配置。
当然,作为用户我会为我自己的行为负责 :) 谢谢你。

@niruix

This comment has been minimized.

Copy link
Owner

@niruix niruix commented Feb 21, 2020

我觉得这个应该写进文档,这样如我们这些小白用户才知道怎么配置。

写文档的时候疏忽了,后面会给出正确的例子。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.