1

I have an ssh configuration file as follows

Host default
   User git
   Hostname github.com
   IdentityFile ~/.ssh/id_rsa

Host work
   User git
   Hostname github.com
   IdentityFile ~/.ssh/work

Host para
   User git
   Hostname github.com
   IdentityFile /home/dev/.ssh/para

I do have access for all the github repos and have added public keys

But when I tried to do the following

ssh -T git@default
ssh -T git@para
ssh -T git@work 

It throws an error

ssh: Could not resolve hostname: Name or service not known

I am using ubuntu 20.04 in VMware player

How to fix this issue?

not 0x12
  • 19,360
  • 22
  • 67
  • 133
  • Where is your ssh configuration file located? – larsks Jan 10 '22 at 21:03
  • 2
    Given that ssh isn't showing the failing host name, it's possible that ssh itself is working fine, and that `github.com` cannot be resolved, due to a *resolver* setup issue. What happens if you use `ssh -T git@github.com -i /home/dev/.ssh/para` for instance? That would point you to whether it's ssh not reading `~/.ssh/config`, or whether it's a more general name-resolution issue. – torek Jan 11 '22 at 04:40
  • Ubuntu 20 doesn't exist. Do you mean 20.04? There's also 20.10 and Core 20. – wjandrea Jan 11 '22 at 05:07
  • Adding debugging info at level 1 `-v` or level 2 `-vv` will give you more information. The `-G` flag "Causes ssh to print its configuration after evaluating Host and Match blocks and exit." so you can see if your host blocks are matching. – spazm Feb 05 '22 at 02:46

1 Answers1

1

You can specify the config file like so:

ssh -F ~/.ssh/config
mincom
  • 670
  • 5
  • 21