You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
503 B

5 years ago
# **ssh-copy-id**
7 years ago
6 years ago
## 说明
7 years ago
5 years ago
**ssh-copy-id命令** 可以把本地主机的公钥复制到远程主机的authorized_keys文件上ssh-copy-id命令也会给远程主机的
用户主目录home和`~/.ssh`, 和`~/.ssh/authorized_keys`设置合适的权限
7 years ago
5 years ago
## 选项
7 years ago
5 years ago
```markdown
7 years ago
ssh-copy-id [-i [identity_file]] [user@]machine
-i指定公钥文件
```
5 years ago
## 实例
7 years ago
5 years ago
```bash
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server # 把本地的ssh公钥文件安装到远程主机对应的账户下
7 years ago
```