<table class="text"><tbody><tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
生成rsa:
ssh-keygen -t rsa -C "
"
生成在 /HOME/.ssh/下
fdipzone@ubuntu:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/fdipzone/.ssh/id_rsa): 这里输入要生成的文件名
Enter passphrase (empty for no passphrase): 这里输入密码
Enter same passphrase again: 这里重复输入密码
Your identification has been saved in /home/fdipzone/.ssh/id_rsa.
Your public key has been saved in /home/fdipzone/.ssh/id_rsa.pub.
The key fingerprint is:
f2:76:c3:6b:26:10:14:fc:43:e0:0c:4d:51:c9:a2:b0 fdipzone@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| .+=*.. |
| . += + |
| o oo+ |
| E . . o |
| ..S. |
| .o . |
| .o + |
| ...oo |
| +. |
+-----------------+
在服务器添加完公钥后报错
sign_and_send_pubkey: signing Failed: agent refused operation
这个时候我们只要执行下
eval "$(ssh-agent -s)"
ssh-add [.加路径] 例如: ssh-add ~/.ssh/vshop_key_rsa
就可以了
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。