mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen -t ssh-copy-id username@server
我得到以下错误:
(名称以斜体更改为保护无辜我的桌面是Ubuntu的,我找不到答案 here)
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle
attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
ab:cd:ef:gh
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get
rid of this message.
Offending key in /home/user/.ssh/known_hosts:1
RSA host key for user.server has changed and you have requested strict
checking.
Host key verification Failed.
ssh-keygen -R hostname
这将从known_hosts中删除违规键
手册页条目如下:
-R hostname
Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).