生成SSH key命令,通常秘钥注释选择是邮箱

  1. ssh-keygen -t rsa -C "密钥的注释"

eg:

  1. ssh-keygen -t rsa -C "baxiang"
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/Users/baxiang/.ssh/id_rsa):

默认会在相应路径下(/your_home_path)生成id_rsaid_rsa.pub两个文件

  1. ls -ll ~/.ssh
  2. -rw------- 1 baxiang staff 2590 6 21 22:57 id_rsa
  3. -rw-r--r-- 1 baxiang staff 561 6 21 22:57 id_rsa.pub

选择回车表示不设置密码

Created directory '/Users/baxiang/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/baxiang/.ssh/id_rsa.
Your public key has been saved in /Users/baxiang/.ssh/id_rsa.pub.
The key fingerprint is:

常见错误处理

ECDSA

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:nlPCw+4W51qbC2IwK1r7IFEda9cwENIw37G3yYIwrCs.
Please contact your system administrator.
Add correct host key in /Users/baxiang/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/baxiang/.ssh/known_hosts:8
ECDSA host key for 123.***.***.34 has changed and you have requested strict checking.
Host key verification failed.
ssh-keygen -R 123.***.***.34

ssh 工具

electerm

https://github.com/electerm/electerm
image.png

FinalShell

http://www.hostbuf.com/t/988.html
image.png

MobaXterm

https://mobaxterm.mobatek.net/download-home-edition.html
image.png

XShell

https://www.netsarang.com/zh/xshell/

termius

https://termius.com/

参考

https://www.codenong.com/p12008869/
https://www.v1tx.com/post/best-ssh-client/