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

[Question] 如何使用密钥监控操作系统/SSH #617

Closed
Janus-Xu opened this issue Feb 6, 2023 · 14 comments · Fixed by #745 or #1084
Closed

[Question] 如何使用密钥监控操作系统/SSH #617

Janus-Xu opened this issue Feb 6, 2023 · 14 comments · Fixed by #745 or #1084
Labels
help wanted Extra attention is needed new feature question Further information is requested

Comments

@Janus-Xu
Copy link

Janus-Xu commented Feb 6, 2023

Question

Ver 1.2.5 ,docker部署
系统中仅看到密码填写,没有高级可选,文档中也没找到公钥的使用
image

@Janus-Xu Janus-Xu added the question Further information is requested label Feb 6, 2023
@hertzbeat hertzbeat changed the title [Question] <系统监控和自定义ssh如何使用公钥> [Question] <How to use public key for system monitoring and custom ssh> Feb 6, 2023
@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Question

Ver 1.2.5, docker deployment
The system only sees the password to fill in, there is no advanced option, and the use of the public key is not found in the document
image

@Janus-Xu Janus-Xu changed the title [Question] <How to use public key for system monitoring and custom ssh> [Question] 如何使用密钥监控操作系统/SSH Feb 6, 2023
@muslimcodeid
Copy link

Facing the same issue

please Advice

@tomsun28
Copy link
Contributor

tomsun28 commented Feb 6, 2023

hi 目前公钥免密登陆的方案支持如下:
在安装包部署环境下(docker不行),将部署hertzbeat所在主机的公钥赋权给对端linux主机,使其能免密登陆,然后在hertzbeat直接添加对端主机即可。

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


hi The current public key password-free login solution supports the following:
In the installation package deployment environment (docker does not work), authorize the public key of the host where hertzbeat is deployed to the peer linux host so that it can log in without password, and then directly add the peer host to hertzbeat.

@Janus-Xu
Copy link
Author

Janus-Xu commented Feb 6, 2023

了解,我按公钥免密的思路,在hertzbeat的docker容器中安装了ssh服务,生成了密钥对,把公钥写入目标主机,测试容器访问目标主机已经免密了,但是系统还是报错。
简单看了下代码对应位置,sshProtocol.getPublicKey()好像没有赋值,这是个bug么
image
image

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I understand, I installed the ssh service in the docker container of Hertzbeat according to the idea of ​​freeing the public key, generated a key pair, and wrote the public key into the target host. The test container access to the target host has been password-free, but the system still reports an error .
After a brief look at the corresponding position of the code, sshProtocol.getPublicKey() does not seem to be assigned a value. Is this a bug?
image
image

@tomsun28
Copy link
Contributor

tomsun28 commented Feb 6, 2023

Hi publicKey 这个属性暂时是没有用到,已支持的这种公钥免密思路是ssh时自动使用本地环境中公钥去尝试。
前端输入publicKey 这种方式我们后面尝试支持一下。
你试试重启hertzbeat docker容器再测下好使吗,我们之前验证也是在安装包环境好使,docker环境不行.

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hi publicKey This attribute is not used for the time being. The idea of ​​exempting the public key is to automatically use the public key in the local environment to try when ssh.
The front-end input publicKey This way we will try to support it later.
Can you try to restart the hertzbeat docker container and test it again? We verified that it works well in the installation package environment, but not in the docker environment.

@Janus-Xu
Copy link
Author

Janus-Xu commented Feb 8, 2023

Hi publicKey 这个属性暂时是没有用到,已支持的这种公钥免密思路是ssh时自动使用本地环境中公钥去尝试。 前端输入publicKey 这种方式我们后面尝试支持一下。 你试试重启hertzbeat docker容器再测下好使吗,我们之前验证也是在安装包环境好使,docker环境不行.

重启试过不行,在提交表单的时候把publicKey mock传给后台试了下也不行,要么就只能下代码调试了,有后续支持计划么?服务器现在都禁密码登录了,应用也都是容器化部署了

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hi publicKey This attribute is not used for the time being. The idea of ​​exempting the public key is to automatically use the public key in the local environment to try when ssh. The front-end input publicKey This way we will try to support it later. Can you try to restart the hertzbeat docker container and test it again? We verified that it works well in the installation package environment, but not in the docker environment.

Trying to restart it doesn't work, and passing the publicKey mock to the background when submitting the form doesn't work, or you can only download the code for debugging. Is there any follow-up support plan? The server now prohibits password login, and the applications are deployed in containers

@tomsun28
Copy link
Contributor

tomsun28 commented Feb 8, 2023

重启试过不行,在提交表单的时候把publicKey mock传给后台试了下也不行,要么就只能下代码调试了,有后续支持计划么?服务器现在都禁密码登录了,应用也都是容器化部署了

后面支持一下 也欢迎你那边代码实现了贡献一波呀

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Tried restarting, but it didn’t work, and it didn’t work after passing the publicKey mock to the background when submitting the form, or I could only download the code to debug. Is there any follow-up support plan? The server now prohibits password login, and the applications are deployed in containers

Please support me later, and you are welcome to make contributions to the code.

@tomsun28 tomsun28 added help wanted Extra attention is needed new feature labels Feb 8, 2023
@gcdd1993 gcdd1993 linked a pull request Mar 17, 2023 that will close this issue
@gcdd1993
Copy link
Contributor

你好,可以试下v1.3.0,支持密钥监控Linux了 @Janus-Xu

@hertzbeat
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hello, you can try v1.3.0, which supports key monitoring Linux @Janus-Xu

@gcdd1993 gcdd1993 linked a pull request Jul 9, 2023 that will close this issue
3 tasks
@tomsun28 tomsun28 moved this to Done in hertzbeat-v1.0 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed new feature question Further information is requested
Projects
None yet
5 participants