LoginSignup
9
5

More than 5 years have passed since last update.

macOS Sierra で git pull できなかった話

Last updated at Posted at 2016-09-23

macOS Sierra にして git pull を実行したら下記のメッセージ。

Unable to negotiate with xx.xx.xx.xx port xx: 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.

よく分からんがアルゴリズムが宜しくない模様。
最近の OpenSSH は、デフォルトで DSA鍵 を非推奨にしたらしい。

対応

(1) ~/.ssh/config にリモートリポジトリのホストを記述

Host example.git
  HostKeyAlgorithms +ssh-dss
  HostName xx.xx.xx.xx
  User hoge

(2) ローカルリポジトリの .git/config を編集

[remote "origin"]
    url = ssh://hoge@xx.xx.xx.xx/path/to/aaa.git

  ↓ ↓ ↓

[remote "origin"]
    url = ssh://example.git/path/to/aaa.git

参考

Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss
OpenSSH Legacy Options


そもそも鍵を新しくしろよって話かも知れん

追記:
わざわざこんなことしなくても~/.ssh/configの一番上にHostKeyAlgorithms +ssh-dssを書くだけで解決できますね...

9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5