1

I am trying to Push some codes into GitHub's Repo, but after following PyCharm's Documentation to set the Remotes,Setting Directory to Repo, and setting the ssh executable to "Built-In" (on Version Control Settings), I got the following error:

  dnb_api: ssh: Could not resolve hostname github.com: Name or service not known Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

the weird thing is: the repo actually exists and the link to connect is in SSH form: "git@github.com:user/repo.git"

It's important to note that I'm under a corporate proxy, but all proxy settings are properly configured (since I can install packages and connect with external APIs). Even the

  'git config --global http.proxy <username>:<password>@proxy:port' 

and

  'git config --global https.proxy <username>:<password>@proxy:port'

where properly configured in the command line.

Do you have an idea how to figure that out?

Petter_M
  • 435
  • 3
  • 10
  • 20

1 Answers1

2

First, SSH would not need to proxy to be set: said proxy would be for HTTPS connections.

Second, double-check in command-line that ssh -Tv git@github.com does work (see "Testing your SSH connection": so you see a welcome message?).
Any mission I have done with corporate client has always involved SSH being blocked by the client proxy.

The OP Petter Mendes indicates:

I updated Windows Credentialswith Git's token and now it's working....

That means:

  • the URL was an HTTPS one, not an SSH one
  • the GitHub account had 2FA activated, in which case only a token works as a password.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Well, I tried to connect but appeared `$ ssh -Tv git@github.com OpenSSH_7.7p1, OpenSSL 1.0.2o 27 Mar 2018 debug1: Reading configuration data /etc/ssh/ssh_config ssh: Could not resolve hostname github.com: Name or service not known `. I think it's due my `/ssh/`file location and/or the corporate proxy. In any case I also tried `ssh -Tv git@github.com "ProxyCommand nc -proxy :@proxy:port %h %p"` but got no success... – Petter_M Mar 20 '19 at 19:43
  • 1
    Yes, that is consistent with any outgoing SSH connection being blocked, which has always been the policy I have seen so far with corporate client. – VonC Mar 20 '19 at 21:04
  • @Petter_Mendes Great! I have updated the answer accordingly. – VonC Mar 21 '19 at 20:55
  • Thank you very much! Although you did not indicated that procedure (`Windows Credentials`) it paved the path to look after other possibilities. – Petter_M Mar 21 '19 at 21:07
  • @Petter_Mendes I did not indicate Windows Credentials (which I knew full well: https://stackoverflow.com/a/48838624/6309) because you mentioned SSH URLs in your question. – VonC Mar 21 '19 at 23:02