Open1

ssh-copy-idコマンドを実行すると「Too many authentication failures」がでる

yoshiyasu1111yoshiyasu1111

公開鍵を作成してサーバにコピーしようとすると「Too many authentication failures」というエラーが出てコピーできませんでした。

$ ssh-keygen -t ed25519
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub yoshi@192.168.122.22
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/yoshi/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Received disconnect from 192.168.122.22 port 22:2: Too many authentication failures

サーバにはsshでパスワード認証でログインできています。

ssh-copy-idコマンドを-o IdentitiesOnly=yesオプションで無事コピーできました。

$ ssh-copy-id -i ~/.ssh/id_ed25519.pub -o IdentitiesOnly=yes yoshi@192.168.122.22
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/yoshi/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
yoshi@192.168.122.22's password: 

Number of key(s) added: 1