现有2台机器
1、服务器192.168.1.112
2、个人机192.168.1.110
要使110无需密码通过ssh登入112
步骤
1、创建密钥
Java代码 收藏代码
1. miao@u32-192-168-1-110:~/.ssh$ ssh-keygen -t rsa
2.
3. Generating public/private rsa key pair.
4. Enter passphrase (empty for no passphrase): (忽略)
5. Enter same passphrase again: (忽略)
6. Your identification has been saved in /home/miao/.ssh/id_rsa.
7. Your public key has been saved in /home/miao/.ssh/id_rsa.pub.
miao@u32-192-168-1-110:~/.ssh$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): (忽略)
Enter same passphrase again: (忽略)
Your identification has been saved in /home/miao/.ssh/id_rsa.
Your public key has been saved in /home/miao/.ssh/id_rsa.pub.
2、复制公密到服务器
Java代码 收藏代码
1. miao@u32-192-168-1-110:~/.ssh$ scp id_rsa.pub miao@192.168.1.112:/home/miao/.ssh/192.168.1.110
2. miao@192.168.1.112's password:
3. id_rsa.pub 100% 404 0.4KB/s 00:00
4. miao@u32-192-168-1-110:~/.ssh$
miao@u32-192-168-1-110:~/.ssh$ scp id_rsa.pub miao@192.168.1.112:/home/miao/.ssh/192.168.1.110
miao@192.168.1.112's password:
id_rsa.pub 100% 404 0.4KB/s 00:00
miao@u32-192-168-1-110:~/.ssh$
3、添加公密到192.168.112的信任区域
Java代码 收藏代码
1. miao@debian-192-168-1-112:~/.ssh$ cat 192.168.1.110 >> authorized_keys
2. miao@debian-192-168-1-112:~/.ssh$
miao@debian-192-168-1-112:~/.ssh$ cat 192.168.1.110 >> authorized_keys
miao@debian-192-168-1-112:~/.ssh$
注: 2,3两步可由命令ssh-copy-id一步到位
Java代码 收藏代码
1. miao@ubuntu-192-168-1-110:~/.ssh$ ssh-copy-id miao@192.168.1.112
2. Password:
3. Now try logging into the machine, with "ssh 'miao@192.168.1.112'", and check in:
4.
5. .ssh/authorized_keys
6.
7. to make sure we haven't added extra keys that you weren't expecting.
miao@ubuntu-192-168-1-110:~/.ssh$ ssh-copy-id miao@192.168.1.112
Password:
Now try logging into the machine, with "ssh 'miao@192.168.1.112'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
4、启动ssh-agent
如果ssh 192.168.112返回 Agent admitted failure to sign using the key
ps -Af|grep agent查看有无ssh-agent有无运行,若没有
Java代码 收藏代码
1. miao@u32-192-168-1-110:~/.ssh$ ssh-agent
miao@u32-192-168-1-110:~/.ssh$ ssh-agent
5、添加id_rsa到ssh-agent
Java代码 收藏代码
1. miao@u32-192-168-1-110:~/.ssh$ ssh-add id_rsa
分享到:
相关推荐
。。。
。。。
agent or student or one video conferencing device not assigned to a unique individual, within your company or legally recognized entity that is authorized by you to directly or indirectly use the ...
All countries can take part if their athletes reach the standard to be admitted to the games. It is just as much a competition among countries to host the Olympics as to win an Olympic medal. 2)语言...
In [Cortez and Morais, 2007], the ...(REC) shows that the SVM model predicts more examples within a lower admitted error. In effect, the SVM model predicts better small fires, which are the majority.
are admitted and priced according to current availability of excess spectrum. Secondary users accept an advertised price with a certain probability defined by an underlying demand function. We analyze...
The London : strictly castle trading conquered authorized votes refusals admitted Permission eventually American pilots : intends routine assault involving aimed waters launched civilian ...
but at the same time, he is the weakest link in the planet’s ecosystem: (1) he cannot optimally manage himself, so he should not be admitted to the management of enterprises, technology, and nature;...
The EHR data of admitted patients are automatically evaluated by an algorithm, which brings patients who are likely to benefit from palliative care services to the attention of the Palliative Care ...
The spaces Bs (Rn) and F s (Rn) can be characterized in terms of Daubechies wavelets for all admitted pq pq parameters s, p, q. The paper deals with related intrinsic wavelet frames (which are almost ...
Achievement in general psychology of regularly-admitted and high-risk college students ACHIEVEMENT I N GENERAL PSYCHOLOGY OF REGULARLY- ADMITTED AND HIGH-RISK COLLEGE STUDENTS ROBERT J. MENGES ...
Early school entrance for intellectually superior children: An analysis t ‘ r ~ h o / o g ~ in rhr Schoolc ...children admitted early to school and the performance of normal children admitted at
Early school entrance for intellectually superior children: An analysis t ‘ r ~ h o / o g ~ in rhr Schoolc ...children admitted early to school and the performance of normal children admitted at
拉斐尔•里维拉在“Within Windows” blog指出该工具包含了一些GPL v2 licence但随后又迅速地删除该文章,UPDATE: Microsoft has admitted that they violated the GPL v2 licence and have now released the tool ...
Achievement in general psychology of regularly-admitted and high-risk college students ACHIEVEMENT I N GENERAL PSYCHOLOGY OF REGULARLY- ADMITTED AND HIGH-RISK COLLEGE STUDENTS ROBERT J. MENGES ...
由于原始数据中并没有给出每一列的列的名字,所以,我们自己加一个 “Exam 1”、"“Exam 2”、"Admitted",我们最好列举前几行数据,确认一下是否读入了数据,并且,看一下数据的维度: - 不懂运行,下载完可以私聊...
观察:病例1:8岁的患者因先天性脑积水在3个月大时有脑室-腹膜分流史,因慢性隐匿性发作的隐匿性发作左侧的功能性阳admitted入院,病程超过9个月,视力模糊和全身性癫痫发作。 CT扫描显示右前额叶有硬膜下异质硬膜...
CONCEPT_ID,PLAN_CONCEPT_ID) 记录插入到METADATA中以记录CDM版本 NOTE_EVENT_ID和NOTE_DOMAIN_ID(NOTE_EVENT_TABLE_CONCEPT_ID)已添加到NOTE ID更改为BIGINT ADMISSION_SOURCE_CONCEPT_ID更改为ADMITTED_FROM_...