SSH “Failed to add the host to the list of known hosts” Openshift

雨燕双飞 提交于 2019-12-10 21:41:27

问题


I tried to use ssh command to connect to another remote host.

ssh -p 21098 -i $OPENSHIFT_DATA_DIR/.ssh/host_key user@domain.com   

The authenticity of host '[domain.com]:21098 ([124.219.148.93]:21098)' can't be established.
RSA key fingerprint is 12:15:79:55:c6:2a:66:1e:82:94:da:19:e1:ca:21:3d.

Are you sure you want to continue connecting (yes/no)?yes
Failed to add the host to the list of known hosts (/var/lib/openshift/541b685c5973cae7bbf006f4/.ssh/known_hosts).

Connection closed by 124.219.148.93

I suppose we do not have access to home/.ssh. So how to solve this problem?


回答1:


One can pass options to SSH on command line, like this:

ssh -o UserKnownHostsFile=/tmp/known_host_file -p 21098 -i $OPENSHIFT_DATA_DIR/.ssh/host_key user@domain.com

Here is related answer: ssh use known_hosts other than $HOME/.ssh/known_hosts



来源:https://stackoverflow.com/questions/27714857/ssh-failed-to-add-the-host-to-the-list-of-known-hosts-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!