我用自己电脑搭建好了git服务器,使用手机Termux和virtualbox中的kali_linux都可以git clone 。
认证使用的是密钥认证。
win10中有加入ssh-add 密钥,也添加密钥成功,但就是最后一步git clone 时提示权限不足。错误如下:
**
git clone git@xxx.xxx.xxx.xxx:stores/test.git**
Cloning into 'test'...
git@xxx.xxx.xxx.xxx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
xxx.xxx.xxx.xxx是我自己主机ip。
还有一个问题是:git clone 能不能指定端口,网上的 git clone git://name@host:port/direcotory/test.git 是不能用的。
密钥的权限是不是600
密匙权限没问题,用其他系统clone就没有问题。只有在win10中ssh-add也没有问题,就是clone的时候权限不足了。服务器应该是没有问题的,问题只出现在win10客户端。