没想到我会被困在这里。在我的win机器上获得了.ssh密钥:我的用户/..ssh/mybitbucket能够使用它从bitbucket.org克隆
需要将项目克隆到RaspberryPi
将mybitbucket和mybitbucket.pub复制粘贴到Raspberry上的~/.ssh,然后粘贴到git clone git@bitbucket.org:[username]/my_utils.git
结果是这样的:
Failed to add the host to the list of known hosts
(/home/pi/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.有什么帮助吗?
我还添加了mybitbucket.pub到authorized_keys,但无法连接到树莓从Xshell与SSH键的原因未知。只需从选项中选择我的键,单击确定,连接窗口就会闪烁,什么也不会发生
编辑:
仅仅为了一个实验,我在Raspberry上生成了一个新的密钥,并将其添加到bitbucket中--它起作用了。但是如何添加现有的密钥呢?
发布于 2018-12-01 01:12:47
无法将主机添加到已知主机列表中
我还向authorized_keys添加了mybitbucket.pub,但无法连接到树莓
我98%确定这两个问题都是由于一个错误的配置造成的:/home/pi/.ssh中的文件属于用户root。要修复,请执行以下操作:
sudo chown -R pi /home/pi/.ssh
chmod -R u=rw,go= /home/pi/.ssh之后,将[my user]/.ssh/config的相关部分复制到/home/pi/.ssh/config。
https://stackoverflow.com/questions/53561366
复制相似问题