24 lines
589 B
Markdown
24 lines
589 B
Markdown
---
|
|
title: ssh config
|
|
createTime: 2022/11/03 16:08:27
|
|
tags:
|
|
- ssh
|
|
---
|
|
|
|
编辑`~/.ssh/config`文件
|
|
|
|
文件格式:
|
|
|
|
```ssh-config
|
|
Host hostalias # 关键词
|
|
HostName example.com or ip addr # 主机地址
|
|
User root # 用户名
|
|
IdentityFile ~/.ssh/id_rrrsa # 认证文件
|
|
Port 22 # 端口
|
|
ProxyCommand command # 代理命令
|
|
```
|
|
|
|
可以使用`ssh hostalias`替代后面一堆配置选项
|
|
|
|
没有指定 hostname 的 IdentityFile 默认还是去 id_rsa 做对应
|