Answer “yes” to terminal on Google Colaboratory

偶尔善良 提交于 2019-12-21 22:06:31

问题


I'm trying to clone from Github using Google Colaboratory, the command I'm using is:

!git clone git@github.com:CliMT/climt.git

But I get the following:

Cloning into 'climt'...
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?

But since this is Google Colaboratory, I can't type "yes" to the terminal.

What can I do?

Thanks!


回答1:


If you only need public-read access you can replace SSH access with https: !git clone https://github.com/CliMT/climt.git

If you're using SSH because you have plans to write to that github repo from the colaboratory runtime then you'll have to set up SSH keys and probably a known_hosts file manually. Or script typing "yes" using something like https://pexpect.readthedocs.io/en/stable/

(FTR note the warning isn't colaboratory-specific: https://help.github.com/articles/testing-your-ssh-connection/)




回答2:


wrong:

!git clone git@github.com:CliMT/climt.git

In jupyter notebook using :

!git clone https://github.com/CliMT/climt.git


来源:https://stackoverflow.com/questions/48709520/answer-yes-to-terminal-on-google-colaboratory

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