问题原文
原帖链接 · user335886 · CC BY-SA 3.0
I have a machine that cannot access the internet, yet can connect to a machine that does. I don't want to use a proxy server, I've been told that I can just use ssh. So I've proceeded simply by
ssh -D 1080 [email omitted]
I've confirmed that this works by doing
curl -v --socks5-hostname localhost:1080 http://google.com
This command returns expected HTML so it must be working.
I have changed my /etc/tsocks.conf to simply read:
server = 127.0.0.1
server_port = 1080
However, apt-get is having none of it;
# tsocks apt-get update
Err http://security.debian.org wheezy/updates Release.gpg
Could not resolve 'security.debian.org'
etc
My /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
I've been googling for a while, I tried adding the following to /etc/apt/apt.conf
Acquire::http::Proxy "http://localhost:1080/";
and not using tsocks at all, (I've tried it both ways), this makes it fail even faster.
I'm out of ideas, this should really work but doesn't. Any help?
已采纳解答
原帖链接 · user335886 · CC BY-SA 3.0
The problem was with DNS.
Apparently, tsocks can't or won't resolve domain names.
I added to /etc/hosts the IP addresses of each of the domain names apt-get was trying to look for and tsocks magically worked.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
