git - Github connection with ssh fail because of bad name resolution -
i have registered ssh key github account. keys in
~/.ssh/id_rsa_github_snail ~/.ssh/id_rsa_github_snail.pub
i have repo wherein remote url configured use ssh:
$ git remote -v origin git@github.com:danielsank/pong.git (fetch) origin git@github.com:danielsank/pong.git (push)
however, when try push company computer, following error message
danielsank@snail:~/src/pong$ git push ssh: connect host github.com.<company>.<name>.com port 22: connection timed out fatal: not read remote repository. please make sure have correct access rights , repository exists.
notice ssh is, reason, trying connect github.com.<company>.<name>.com
instead of github.com
.
i have discovered following suspicious bit in /etc/resolve.conf
:
# common within <company> lookup hostnames dot in # example '<machine>.<site>'. set 'options ndots:2' such hostnames # tried first <company> search domains appended. without such # queries might tried first against external dns resolver. options ndots:2
i can ping github.com.
i tried setting url git@github.com.:danielsank/pong.git
. after doing that, when try push, asked accept host fingerprint github, different error:
permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists.
which imagine happening because of dot in repo name.
is there way work around configuration? i'm kinda surprised resolution doesn't try again without appending company name...
it seems have strange dns settings in /etc/resolve.conf
or in company's nameserver. prevent these dns settings append .<company>.<name>.com
host names dot append dot @ end of host names:
ping github.com. # <- note dot! git remote set-url origin git@github.com.:danielsank/pong.git
about second problem — if want use key nonstandard name, have, can assign keys hosts in ~/.ssh/config
:
host github.com github.com. user git identityfile ~/.ssh/id_rsa_github_snail
Comments
Post a Comment