Hot answers tagged

77 votes

How to use socks proxy for commands in Terminal such as youtube-dl?

ssh -D 8080 name@myserver.com export http_proxy=socks5://127.0.0.1:8080 https_proxy=socks5://127.0.0.1:8080 youtube-dl "youtube.com/watch?V=3XjwiV-6_CA"
user avatar
  • 771
77 votes
Accepted

Unable to add gpg key with apt-key behind a proxy

You usually have a proxy for ftp, http and https; I am seeing there hkp:// as an URL; so it should not be directed via a pure http proxy, hence failing the communication. Use this instead: sudo apt-...
user avatar
59 votes

Proxy (nginx) shows a Bad gateway error

I assume its a Linux box, so most likely SELinux is preventing the connection as there is no policy allowing the connection. You should be able to just run # setsebool -P httpd_can_network_connect ...
user avatar
  • 691
38 votes
Accepted

How does a transparent SOCKS proxy know which destination IP to use?

Here is how it does it: static int getdestaddr_iptables(int fd, const struct sockaddr_in *client, const struct sockaddr_in *bindaddr, struct sockaddr_in *destaddr) { socklen_t socklen = ...
user avatar
  • 41.1k
22 votes

Unable to add gpg key with apt-key behind a proxy

Here is a solution that uses http via curl instead of trying to proxy apt-key or gpg: curl -sSL \ 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xBBEBDCB318AD50EC6865090613B00F1FD2C19886' ...
user avatar
19 votes
Accepted

Disable SSH tunnel "open failed" messages

ssh writes that particular message as a log message at the info level. Log messages are written to standard error by default. Ssh has options to control what is logged. The configuration setting ...
user avatar
  • 2,701
17 votes
Accepted

Set Ubuntu System Proxy Settings without Restart from commandline

From what I understand, setting proxies system-wide via that GUI does three things: Set the corresponding values in the dconf database. Set the values in /etc/environment. Set the values in /etc/apt/...
user avatar
  • 64.3k
17 votes

How do I set systemwide connection over a proxy server

There are various solutions for this: 1. Configuring http_proxy variables You can set $http_proxy and other such variables. Most applications will pick this variable automatically. To set it system-...
user avatar
  • 4,398
13 votes
Accepted

Curl 7.27: [ANY]_PROXY set; curl does not resolve the hostname via proxy

OK for idiots like me, here's the subtle part: Since 7.21.7, this option is superfluous since you can specify a socks5 hostname proxy with -x, --proxy using a socks5h:// protocol prefix. The ...
12 votes

How to use socks proxy for commands in Terminal such as youtube-dl?

youtube-dl works well with proxychains on ubuntu. Make sure ur tunneling via command line. ssh -D 8081 ubuntu@yourSSHserver next install proxychains on your localhost not the ssh server ur conncted ...
user avatar
11 votes

Using curl to access basic auth protected website via proxy (polipo)

Not necessary to use http_proxy, try this: curl -x PROXY-SERVER:PORT -U USER:PASS URL curl -x 127.0.0.1:8123 -U XXXXX:Pass "http://example.com/blub/bla.bin"
user avatar
  • 2,894
11 votes

How to unset the 'http_proxy' environment variable in Python

Each invocation of os.system() runs in its own subshell, with its own fresh environment: >>> import os >>> os.system("echo $$") 97678 0 >>> os.system("echo $$") 97679 0 ...
user avatar
  • 68.1k
10 votes

How to use yaourt on arch linux under proxy?

I would advise to use a solid proxying tool for all (or most) of your proxy needs. $ proxychains4 yaourt -S application proxychains-ng works well - but be sure to configure proxychains.conf before ...
user avatar
  • 371
9 votes
Accepted

Redirect ALL packets from eth1 & eth2 through a SOCKS proxy

First, you need tun2socks (often a part of the 'badvpn' package). tun2socks sets up a virtual interface which you can route traffic through, and that traffic will get sent through the target socks ...
user avatar
  • 67.6k
8 votes
Accepted

Failed getting release file while running debootstrap with sudo

sudo sets up only a limited environment and you might for instance miss the http_proxy env variable that gets initiated by your login shell. You might try to run sudo with the -i option as that will ...
user avatar
  • 6,988
8 votes
Accepted

On-demand SSH Socks proxy through systemd user units with socket-activation doesn't restart as wished

Can /usr/bin/ssh really not accept systemd-passed sockets? I think that's not too surprising, considering: OpenSSH is an OpenBSD project systemd only supports the Linux kernel systemd support would ...
user avatar
8 votes
Accepted

netcat missing -x option

Looks like you have the "traditional" netcat (netcat-traditional) installed. The -x option is available in the OpenBSD netcat (netcat-openbsd). See also: What are the differences between ...
user avatar
  • 64.3k
7 votes

Setting up Proxy Settings on Debian

The following is for general proxy, apt and wget and you can remove the user:password@ for a proxy that doesn't require it: For General proxy: touch /etc/profile.d/proxy.sh add the following: ...
user avatar
7 votes
Accepted

Can't install debian because installer doesn't parse IP correctly?

Try http://192.168.2.2:3128/ with a trailing slash. Without examining the debian-installer code, I can't say why it works, and from force of habit I have always entered the proxy server that way (...
user avatar
  • 64.3k
7 votes

How to use yaourt on arch linux under proxy?

You can edit /etc/sudoers with the visudo command and add this line Defaults env_keep += "http_proxy https_proxy ftp_proxy" This pass the current user environment variables to the command excecuted ...
user avatar
6 votes
Accepted

Get transmission web interface working with web server

I was able to get this working just now with the following location in my config: location /transmission { proxy_pass http://127.0.0.1:9091; proxy_pass_header X-...
user avatar
6 votes

What do the %h and %p do in this command?

It's in the manpage, under the section for ProxyCommand: Specifies the command to use to connect to the server. The command string extends to the end of the line, and is executed with the user's ...
user avatar
  • 41.1k
6 votes

Bash Script - Setting Local Environment Variables (Proxy)

It looks like there are several mistakes here. First, your variable assignment expressions shouldn't be inside backticks. The backticks are a (somewhat dated) syntax for command substitution. I think ...
user avatar
  • 9,039
6 votes
Accepted

Proxy setting: How to keep my password more secure

Someone getting the password from your terminal is the least of your problems. The bigger problem is that using the proxy via a non-encrypted protocol over the network, your login and password can ...
user avatar
5 votes
Accepted

Proxy server with authentication not working at command line

You should pass the export http_proxy command as a string. This should do the trick: export http_proxy='http://domain\username@proxyIPaddress:8080/'
user avatar
  • 924
5 votes

Proxy (nginx) shows a Bad gateway error

Based on the error message, it makes me wonder if localhost:5000 is being resolved as an ipv6 address, which you may not want. You could try changing that to 127.0.0.1:5000 EDIT: In your proxy_pass ...
user avatar
  • 1,029
5 votes
Accepted

Browser is ok but can't direct internet through a shadowsocks server

There is no general way to tunnel every Internet traffic through a SOCKS-proxy. However, there are specific ways for quite a few protocols - but not all of them. SOCKS5 supports TCP and UDP traffic, ...
user avatar
  • 1,222
5 votes

Can I set a proxy for specific yum repositories?

Did you try it yet? Should work, according to e.g. https://superuser.com/a/561473/365864 - but see some more examples in the upstream bugreports: Bug 270521 - yum does not honor per-repo proxy-setting ...
user avatar
  • 2,589
5 votes

How do you use proxy with the whois command?

The whois command talks in a specific protocol and port, namely whois 43/tcp ; so obviously trying to use an HTTP(S) (HTTP port 80/tcp and HTTPS 443/tcp by default). So HTTP proxies-aware won't ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible