Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 682 Bytes

ssh-config-file.md

File metadata and controls

38 lines (25 loc) · 682 Bytes

SSH config file

To avoid typing complex commands to ssh to your servers you can utilize ~/.ssh/config

Imagine you connect to your server using following command:

ssh -p 2222 [email protected]

This command can be simplified using ~/.ssh/config. To do so, we need to create config file and put our data into it:

vi ~/.ssh/config

Now we can use following template:

# This is an example of `~/.ssh/config` file
Host example
  HostName 192.168.0.1
  Port 2222
  User admin

and save the file(:wq)

Now to connect to the server we can simply run:

ssh example

More info can be found here: https://linux.die.net/man/5/ssh_config