How to use ssh config
2021-11-30 00:38:38
1 minutes read
By default SSH use native config file ~/.ssh/config
without extension.
How to use it:
Host {alias}
HostName {host name or ip address}
User {username}
# Port {port} - optional
# IdentityFile {path/to/ssh-private-key} - optional
# Compression {yes or no} - optional
# ConnectTimeout {time in seconds} - optional
For example your ~/.ssh/config
file:
Host host1
HostName api.host.com
User root
You could to connect to your host with command:
ssh host1