win+r打开cmd,输入如下,期间的要求连按三次回车即可。
ssh-keygen -t rsa
结果如下:
- Generating public/private rsa key pair.
- Enter file in which to save the key (C:\Users\***/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in C:\Users\***/.ssh/id_rsa.
- Your public key has been saved in C:\Users\***/.ssh/id_rsa.pub.
- The key fingerprint is:
- *************************************************************
- The key's randomart image is:
- +---[RSA 3072]----+
- | .BX&E . |
- |. . +=Oo=o o |
- |..o =o=..+ + |
- | o.o = .o + |
- |..o o S+ . |
- | o.. . o |
- |.o |
- |..+ . |
- | oo+.. |
- +----[SHA256]-----+
详细文件如下:



填下服务器的账户名称
- 将公钥文件内容追加到authorized_keys文件中
- cd ~/.ssh
- cat id_rsa.pub >> authorized_keys
-
- 注:如果~/.ssh目录下不存在authorized_keys文件手动添加
-
- touch authorized_keys
- 修改权限
- chmod 700 ~/.ssh/
- chmod 600 ~/.ssh/authorized_keys
https://blog.csdn.net/weixin_45606655/article/details/123176831
https://blog.csdn.net/zhuguanlin121/article/details/125436015
https://blog.csdn.net/weixin_41862755/article/details/122093462