demo1984s 的个人博客
title:Gidder-Android手机随身git服务器
date: '2018-10-27 09:38:40'
updated: '2018-10-27 13:30:38'
tags: [Gidder,Android,ssh,ssh-dss,ssh_config]

remote: Total 50 (delta 1), reused 50 (delta 1)R (36/50)
Receiving objects: 100% (50/50), 26.64 KiB | 2.22 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Win10 解决。
MyMacBook:git demo1984s$ git clone ssh://demo1984s@m.hp-shell.git:2222/hp-shell.git
Cloning into 'hp-shell'...
Unable to negotiate with 192.168.0.156 port 2222: no matching host key type found. Their offer: ssh-dss
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
同Win10,修改 ~/.ssh/config 文件(如果不存在则新建一个)
Host m.hp-shell.git
HostKeyAlgorithms +ssh-dss
再次执行 git clone,发现新的报错信息如下:
MyMacBook:git demo1984s$ git clone ssh://demo1984s@m.hp-shell.git:2222/hp-shell.git
Cloning into 'hp-shell'...
Unable to negotiate with 192.168.0.156 port 2222: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
同样的网上看了很多解决方案,最终在 /etc/ssh/ssh_config 新增一行解决:
sudo vi /etc/ssh/ssh_config
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
再次执行:
clone:git clone ssh://demo1984s@m.hp-shell.git:2222/hp-shell.git
Cloning into 'hp-shell'...
The authenticity of host '[m.hp-shell.git]:2222 ([192.168.0.156]:2222)' can't be established.
DSA key fingerprint is SHA256:IeQlLoT84XtZ/ZfdkKNbqu13exRxdWZVAhnATTZcArc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[m.hp-shell.git]:2222,[192.168.0.156]:2222' (DSA) to the list of known hosts.
demo1984s@m.hp-shell.git's password:
warning: You appear to have cloned an empty repository.
终于搞定。