Connecting GitHub through Tor is not working - linux

I'm using GitHub through Tor because Git ports are blocked on my network.
I'm using Fedora 17 GNU Linux. Suddenly I could not connect to GitHub through Tor today. Any troubleshooting methods or suggestions?
Here is the error I get:
fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=Connection timed out
Tor is working fine. I can connect other applications to 127.0.0.1:9050 and the proxy is working fine.

You'll get this message if you haven't set your git user properties
Check to see if you have ~/.gitconfig
Then do:
git config --global user.name "your-user-name"
git config --global user.email your#email-address.com

I have setup Tor through GitHub using at assembla.com (which unfortunatley is not available now, but what you have to do is set proxy options for git and in those you have to specify the tor proxy) but found that I haven't updated my ~/.bashrc.
something similar to this tutorial.

Related

ssh: Could not resolve hostname github.com: Temporary failure in name resolution

The repo was cloned using SSH at the start. I had no issues pushing to Github until today. I've been trying to solve this error for a whole day but i still cannot solve this error.. It would be great if anyone can shed some light on this! Thank you :)
2dsnakegame git:(main) git push origin main
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
➜ 2dsnakegame git:(main) git remote
origin
➜ 2dsnakegame git:(main) git remote --v
origin git#github.com:xxxx/2dsnakegame.git (fetch)
origin git#github.com:xxxx/2dsnakegame.git (push)
I had the same situation working on Windows with WSL2. It looks like there was a trouble on the connection to the DNS server, so I basically reset my TCP/IP with the following commands and then git pull/git push worked again.
From University of Wisconsin: Windows 10 TCP/IP Reset: Open the cmd prompt on Windows as an administrator and run the following commands in this order in order to fix your connection problem:
netsh winsock reset
netsh int ip reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns
Finally, restart your computer.

git clone fatal error - repository 'https' does not exist

I am trying to get a git clone of a github repo, namely odoo (formerly OpenERP). When trying to run the git clone command in Centos 8, I get the following error:
error as shown in terminal
I am running this command in root. I have tried running it as sudo.
The machine is running in a VPS, and seems to have https resolving issues. I can't ping google through https for instance. I also checked, and there is no firewall causing issues. https ping attempt
How do I best approach this? I'm not sure if it is a name server issue or the like.
Try git clone https://github.com/odoo/odoo.git --depth 1 -b 13.0
Ping requires only hostname, not a URL. Try pinging ping google.com

Can anyone access pluggable-transports/meek.git?

git clone https://git.torproject.org/pluggable-transports/meek.git
fatal: unable to access 'https://git.torproject.org/pluggable-transports/meek.git/': Failed to connect to gitweb.torproject.org port 443: Connection timed out
and I get TorBrowser running ,and config git with
git config --global http.proxy 'socks5://127.0.0.1:9150'
git config --global https.proxy 'socks5://127.0.0.1:9150'
and git clone get these message:
fatal: unable to access 'https://git.torproject.org/pluggable-transports/meek.git/': Can't complete SOCKS5 connection to 0.0.0.0:0. (1)
Does meek source code accessible?
I want use tor not JUST TorBrowser Bundle . and I need meek to get out the GFW .
curl https://torproject.org --socks5 '127.0.0.1:9150'
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (6)
TorBrowser 6.0.6 is running
ScreenShot
The apparent problem is that Git's HTTP(S) proxy doesn't do DNS resolution over SOCKS and relies on your system DNS server. So when you try to clone (via https://gitweb.torproject or the .onion site) it's doing a DNS lookup through your default DNS servers which I think are giving you bad information.
This should work (because it resolves DNS over Tor):
curl https://torproject.org --socks5-hostname '127.0.0.1:9150'
While this probably doesn't (because it uses your default DNS servers):
curl https://torproject.org --socks5 '127.0.0.1:9150'
That said, I didn't try very hard or look more into having Git's proxy resolve DNS over SOCKS, but the easier thing to do is try using torsocks or proxychains.
Go to https://github.com/rofl0r/proxychains-ng - download, configure, build, and install. Then edit /etc/proxychains.conf and change socks4 127.0.0.1 9050 to socks5 127.0.0.1 9150
Then run:
./proxychains4 git clone http://dccbbv6cooddgcrq.onion/pluggabletransports/meek.git
If it works, you're set.
The directory permissions are fine. They show up funny in the web viewer d--------- but when you clone it, the directories will get permissions (probably 0755) based on your umask.
In any case, if you're still stuck, I've uploaded the meek git clone to https://drew.co.il/downloads/meek.zip so you can try to download that. It'll have the .git directory in it in case you need that later.
I checked meek source tree ,and find out it has d--------- permission . There is no 'w',nor 'x' and no 'r' ,but yet ,the directory can be accessed from browser ,and its file has 644 permission . Perhaps that's why i cann't clone it .
BTW,TBB's proxy works fine . and git's proxy configuration also right . If anyone else wants to know .

Accessing Github behind corporate proxy Node.js

I am having an issue with calling the following command from cmd for installing PhoneGap:
npm install -g phonegap
The following error is returned:
Failed to connect to github.com port 443: Timed out
There are a fair amount of questions regarding this topic and they all seem to provide the same answer - make sure the proxy settings for git and nodejs are configured. I set up the node proxy settings like so:
npm config set proxy http://proxyname:8080
npm config set https-proxy http://proxyname:8080
And for git:
git config --global http.proxy http://proxyname:8080
git config --global https.proxy http://proxyname:8080
Both git config --list and npm config list confirm that these proxy settings are in place.
I have also allowed the programs through the fire wall by going to Windows Firewall -> Allow a program or feature through windows firewall. Then I selected the node.exe for Node.js and for git I selected git.exe.
I still however have the issue whereby it is failing to connect to Github. Is there anything else I am missing or forgetting to setup? Both Node.js and Git were installed for the first time for this task.
In addition to the above settings, it's possible that you're getting this error if some of the downloaded libraries declare their dependencies using the git:// protocol instead of https://. These dependencies then usually fail with the above error.
To fix this, you can run the following:
git config --global url."https://".insteadOf git://
This will add a configuration option to Git, asking Git to use https whenever a URL uses the git:// protocol.
This setting fixed many proxy issues for me.
You need to add proxy authentication to your command application. I assume you are working in windows, the following works for me (I don't need to add the proxy to either npm or git unless running git commands).
In your active command window you need either or both of these for each session including initial instalation adding devices or plugins and on first application build:
set https_proxy=http://username:password#proxy:port
set http_proxy=http://username:password#proxy:port
So mine looks like this:
set https_proxy=http://john.doe:1234#proxy.det.nsw.edu.au:8080
Ben
With git 2.8 (March 2016), you don't have to embed in clear text your password in the url.
See commit 372370f, commit ef97639 (26 Jan 2016) by Knut Franke (``).
Helped-by: Junio C Hamano (gitster), Eric Sunshine (sunshinebell28), and Elia Pinto (devzero2000).
(Merged by Junio C Hamano -- gitster -- in commit 30f302f, 03 Feb 2016)
http: use credential API to handle proxy authentication
Currently, the only way to pass proxy credentials to curl is by including them in the proxy URL. Usually, this means they will end up on disk unencrypted, one way or another (by inclusion in ~/.gitconfig, shell profile or history).
Since proxy authentication often uses a domain user, credentials can be security sensitive; therefore, a safer way of passing credentials is desirable.
If the configured proxy contains a username but not a password, query the
credential API for one. Also, make sure we approve/reject proxy credentials
properly.
So:
In addition to the syntax understood by curl, it is possible to specify a proxy string with a user name but no password, in which case git will attempt to acquire one in the same way it does for other credentials.
See gitcredentials for more information.
The syntax thus is:
[protocol://][user[:password]#]proxyhost[:port]
This can be overridden on a per-remote basis; see remote.<name>.proxy.
http: allow selection of proxy authentication method
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests with a 307 redirect to an error page instead of a 407 listing supported authentication methods.
Therefore, allow the authentication method to be set using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuration variables http.proxyAuthmethod and remote.<name>.proxyAuthmethod (in analogy
to http.proxy and remote.<name>.proxy).
The following values are supported:
anyauth (default)
basic
digest
negotiate
ntlm

strange behaviour of git

i have strange behaviour of git - push is working, but clone is not :(
alec$ git clone git://host/repo.git
Initialized empty Git repository in /Users/alec/Temp/repo/.git/
host[0: x.x.x.x]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
whats wrong?
Push is probably working over SSH (port 22) but clone works over the git port (port 9418). You (or your network admin) will have to open this port if you want to be able to clone repositories.
Try using the Github or Bitbucket (Sourcetree) apps. They usually have less errors, and do most of everything that the command line does. I use bitbucket because their GUI git app is complex and provides many options.
Bitbucket http://bitbucket.org
GitHub http://github.com

Resources