Skip to main content
Corrected example configuration snippet provided in the answer
Source Link

For github.com your ~/.ssh/config might look like this

Host github.com
    IdentityFile ~/.ssh/key_name_for_github

For hostname: as man says it allows you to specify abbreviation for host. For example, if your ~/.ssh/config look like this

Host host1
    HostName host1.example.com
Host host2
    HostName anotherdomain.com

Then when you type

ssh host1

you actually login to host1.example.com

ssh host2

login to anotherdomain.com

  • ssh host1 you actually login to host1.example.com
  • ssh host2 login to anotherdomain.com

For github.com your ~/.ssh/config might look like this

Host github.com
    IdentityFile ~/.ssh/key_name_for_github

For hostname: as man says it allows you to specify abbreviation for host. For example, if your ~/.ssh/config look like this

Host host1
    host1.example.com
Host host2
    anotherdomain.com

Then when you type

ssh host1

you actually login to host1.example.com

ssh host2

login to anotherdomain.com

For github.com your ~/.ssh/config might look like this

Host github.com
    IdentityFile ~/.ssh/key_name_for_github

For hostname: as man says it allows you to specify abbreviation for host. For example, if your ~/.ssh/config look like this

Host host1
    HostName host1.example.com
Host host2
    HostName anotherdomain.com

Then when you type

  • ssh host1 you actually login to host1.example.com
  • ssh host2 login to anotherdomain.com
Source Link
int
  • 576
  • 4
  • 4

For github.com your ~/.ssh/config might look like this

Host github.com
    IdentityFile ~/.ssh/key_name_for_github

For hostname: as man says it allows you to specify abbreviation for host. For example, if your ~/.ssh/config look like this

Host host1
    host1.example.com
Host host2
    anotherdomain.com

Then when you type

ssh host1

you actually login to host1.example.com

ssh host2

login to anotherdomain.com