[why] The "pub_key" field in yaml will not be set under sshd, It should be set as level-1 parameter for password-free login, and "sshd" can be placed below the "on_fail" field or elsewhere.
Signed-off-by: Zhang Yale ylzhangah@qq.com --- src/lib/job.cr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index a4402ab..44a6ecf 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -184,7 +184,7 @@ class Job end
private def set_sshr_info - return unless self["sshd"]? + return unless @hash["pub_key"]?
self["sshr_port"] = ENV["SSHR_PORT"] self["sshr_port_base"] = ENV["SSHR_PORT_BASE"] @@ -196,8 +196,7 @@ class Job end
private def set_my_ssh_pubkey - sshd = @hash["sshd"].as_h? || Hash(String, JSON::Any).new() - pub_key = sshd["pub_key"]?.to_s + pub_key = @hash["pub_key"]?.to_s update_account_my_pub_key(pub_key)
@hash["my_ssh_pubkey"] = @account_info["my_ssh_pubkey"]