Skip to content

Commit 0c60c64

Browse files
committed
2018-02-08 补充免密登录
1 parent 65e586d commit 0c60c64

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [Ubuntu 安装 VMware](Ubuntu-Install-VMware.md)
2424
- [VMware 克隆 CentOS 后网卡信息修改](CentOS-Virtual-Machine-Copy-Settings.md)
2525
- [Vim 安装、配置、快捷键列表](Vim-Install-And-Settings.md)
26+
- [SSH 免密登录](SSH-login-without-password.md)
2627
- [Bash 命令](Bash.md)
2728
- [Bash 其他常用命令](Bash-Other-Bash.md)
2829
- [Sed 命令](Sed.md)
@@ -78,6 +79,7 @@
7879
- [Alfresco 安装和使用](Alfresco-Install-And-Usage.md)
7980
- [Apache Thrift 安装和使用](Thrift-Install-And-Usage.md)
8081
- [Node.js 安装和使用](Node-Install-And-Usage.md)
82+
- [CI 整套服务安装和使用](CI-Install-And-Usage.md)
8183

8284

8385
## 下一步(Next)

SSH-login-without-password.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SSH 免密登录
2+
3+
## 环境说明
4+
5+
- CentOS 7.3
6+
7+
## 关键点
8+
9+
- 免密登录的关键点在于理解谁登录谁。
10+
- A 生成的公钥给 B,也给 C、D,则 A 可以直接免密 SSH 登录 B、C、D
11+
12+
## A 生成密钥
13+
14+
- 命令:`ssh-keygen`
15+
- 根据提示回车,共有三次交互提示,都回车即可。
16+
- 生成的密钥目录在:**/root/.ssh**
17+
18+
19+
## 把 A 的公钥发给 B
20+
21+
- 假设 B 机器的 ip:`192.168.1.105`
22+
- 则在 A 机器上输入:`ssh-copy-id -i /root/.ssh/id_rsa.pub -p 22 root@192.168.1.105`,根据提示输入 B 机器的 root 密码,成功会有相应提示
23+
24+
## 测试 A 免密登录到 B
25+
26+
- 在 A 机器上输入命令:`ssh -p 22 root@192.168.1.105`

0 commit comments

Comments
 (0)