Because pub_key is in sshd, and sshd is a hash. Hash will skip in "sh_export_top_env", So job.sh can't get the array pub_key to do password-free login. Add a new key "my_ssh_pubkey" in job to solve this problem.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/lib/job.cr | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 785daea..b533665 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -206,6 +206,7 @@ class Job
sshd["pub_key"] = @account_info["my_ssh_pubkey"] @hash["sshd"] = JSON.parse(sshd.to_json) + @hash["my_ssh_pubkey"] = @account_info["my_ssh_pubkey"] end
private def update_account_my_pub_key(pub_key)