blog icon indicating copy to clipboard operation
blog copied to clipboard

如何在Linux平台下科学上网

Open realDuYuanChao opened this issue 7 years ago • 44 comments

YouTube视频教学

购买高速Shadowsocks账号

首先运行Shadowsocks

如使用 nohup sslocal -c config.json & 后台运行Shadowsocks,假如你的本地机器运行以下ip和port

127.0.0.1 1080

安装proxychains

On Debian/Ubuntu:

apt-get install proxychains

On Centos

yum install proxychains

On Mac OS X:

brew install proxychains-ng

创建配置文件

mkdir ~/.proxychains/ && touch proxychains.conf

编辑配置文件

vim ~/.proxychains/proxychains.conf

strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode

[ProxyList]
socks5  127.0.0.1 1080

运行

使用proxychains运行命令

proxychains google-chrome
proxychains4 curl https://www.twitter.com/
proxychains4 git push origin master

或者这样

proxychains4 bash
wget https://www.google.com
git push origin master

注意:

如果没有安装dig发现无法上网,因为proxychains使用了dig工具

安装dig

ubuntu/debian

sudo apt-get install dnsutils

centos

sudo yum install bind-utils

realDuYuanChao avatar Jul 17 '18 15:07 realDuYuanChao

提示:!!!need more proxies!!!

JaydenSoong avatar Oct 15 '18 02:10 JaydenSoong

@JaydenSoong 什么系统?什么版本?最好截图

realDuYuanChao avatar Oct 15 '18 04:10 realDuYuanChao

谢谢,我用的是 Ubuntu 18.04,在使用 proxychains 的时候出现的问题。不过我发现可以不使用 proxychains 而是直接用 Ubuntu 的网络设置。

JaydenSoong avatar Oct 15 '18 06:10 JaydenSoong

是的,可以直接设置系统代理,或者直接给google浏览器安装插件proxy-switchysharp

realDuYuanChao avatar Oct 15 '18 06:10 realDuYuanChao

@shellhub 对,后来我发现用系统代理是全局的,访问国内资源太慢。然后我现在就是在 google-chrome 中使用的插件。谢谢了

JaydenSoong avatar Oct 15 '18 07:10 JaydenSoong

这种方法需要购买vps吗? 能把nohup sslocal -c config.json, json文件内容粘贴出来吗

perry385817606 avatar Oct 31 '18 08:10 perry385817606

这种方法需要购买vps吗? 能把nohup sslocal -c config.json, json文件内容粘贴出来吗

https://ss.duyuanchao.me 购买连接

配置文件如下

{
    "server":"my_server_ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

realDuYuanChao avatar Oct 31 '18 08:10 realDuYuanChao

proxychains curl https://www.google.com ProxyChains-3.1 (http://proxychains.sf.net) curl: (6) Could not resolve host: www.google.com

请问这是什么原因

chocozhao avatar Nov 21 '18 05:11 chocozhao

你是不是ss没有启动或者没有正确配置好proxychains @chocozhao

realDuYuanChao avatar Nov 21 '18 05:11 realDuYuanChao

这是我的配置图片 2018-11-21 13-49-19 2018-11-21 13-49-58

chocozhao avatar Nov 21 '18 05:11 chocozhao

我试了几次不能用 提示pi@raspberrypi:~ $ proxychains wget www.google.com ProxyChains-3.1 (http://proxychains.sf.net) --2018-12-02 07:36:51-- http://www.google.com/ 正在解析主机 www.google.com (www.google.com)... 0.0.0.0 正在连接 www.google.com (www.google.com)|0.0.0.0|:80... !!!need more proxies!!! 失败:拒绝连接。

jth445600 avatar Dec 02 '18 07:12 jth445600

你对着试试来吧!

On Sun, Dec 2, 2018, 3:38 PM jth445600 <[email protected] wrote:

我试了几次不能用 提示pi@raspberrypi:~ $ proxychains wget www.google.com ProxyChains-3.1 ( http://proxychains.sf.net) --2018-12-02 07:36:51-- http://www.google.com/ 正在解析主机 www.google.com (www.google.com)... 0.0.0.0 正在连接 www.google.com ( www.google.com)|0.0.0.0|:80... !!!need more proxies!!! 失败:拒绝连接。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/10#issuecomment-443488062, or mute the thread https://github.com/notifications/unsubscribe-auth/AfEC14DrzQ6WeImhn4wfqiPsJoyfSKlKks5u04NogaJpZM4VTDzh .

realDuYuanChao avatar Dec 02 '18 07:12 realDuYuanChao

我找到解决方法了,直接修改/etc目录下proxychains配置文件即可,把最后一行删除,改成您给的配置文件的最后一行。

jth445600 avatar Dec 02 '18 08:12 jth445600

好的!恭喜

On Sun, Dec 2, 2018, 4:00 PM jth445600 <[email protected] wrote:

我找到解决方法了,直接修改/etc目录下proxychains配置文件即可,把最后一行删除,改成您给的配置文件的最后一行。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/10#issuecomment-443489118, or mute the thread https://github.com/notifications/unsubscribe-auth/AfEC1_izGm8BfmfTBAl2OC3LYgbzLdY7ks5u04ihgaJpZM4VTDzh .

realDuYuanChao avatar Dec 02 '18 08:12 realDuYuanChao

这种方法需要购买vps吗? 能把nohup sslocal -c config.json, json文件内容粘贴出来吗

https://www.ssrhub.com 购买连接

配置文件如下

{
    "server":"my_server_ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

你好,你给的这个vps的地址失效了,还有其他的卖ss账号的网站吗

DreamXzxy avatar Dec 16 '18 12:12 DreamXzxy

终端可以用吗?是透明路由吗?

sphinxyun avatar Feb 01 '19 05:02 sphinxyun

可以用

On Fri, Feb 1, 2019 at 1:31 PM sphinxyun [email protected] wrote:

终端可以用吗?是透明路由吗?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/10#issuecomment-459611147, or mute the thread https://github.com/notifications/unsubscribe-auth/AfEC159CJ2QUhruXJWXZXPfIgiG7qC8wks5vI9EZgaJpZM4VTDzh .

realDuYuanChao avatar Feb 01 '19 05:02 realDuYuanChao

火狐浏览器这么开启啊?

andsw avatar Feb 11 '19 08:02 andsw

proxychains curl https://www.google.com ProxyChains-3.1 (http://proxychains.sf.net) curl: (6) Could not resolve host: www.google.com

请问这是什么原因

我也遇到了相同的问题。。。按照步骤一步一步走的。。

website19880927 avatar Feb 24 '19 13:02 website19880927

你看着视频来的么?你首先确保开启了ss,然后代理端口也填写对

realDuYuanChao avatar Feb 24 '19 13:02 realDuYuanChao

proxychains curl https://www.google.com ProxyChains-3.1 (http://proxychains.sf.net) curl: (6) Could not resolve host: www.google.com 请问这是什么原因

我也遇到了相同的问题。。。按照步骤一步一步走的。。

Me too。。。我用树莓派系统。 image 被占用了 这里需要修改哪个参数了。

website19880927 avatar Feb 27 '19 05:02 website19880927

proxychains curl https://www.google.com ProxyChains-3.1 (http://proxychains.sf.net) curl: (6) Could not resolve host: www.google.com 请问这是什么原因

我也遇到了相同的问题。。。按照步骤一步一步走的。。

Me too。。。我用树莓派系统。 image 被占用了 这里需要修改哪个参数了。

{
    "server":"my_server_ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

修改local_port字段,然后重启shadowsocks

realDuYuanChao avatar Feb 27 '19 07:02 realDuYuanChao

谢谢,我用的是 Ubuntu 18.04,在使用 proxychains 的时候出现的问题。不过我发现可以不使用 proxychains 而是直接用 Ubuntu 的网络设置。

在成功上一次google后,我也遇到了 need more proxies! 的情况,并且现在无法上google。 请问你说的系统代理(网络设置)是如何做的,感谢。

3santree avatar Mar 03 '19 09:03 3santree

这样的方案需要在每次开机之后自行打开命令行使用 nohup sslocal -c config.json & nohup proxychains google-chrome & 这两条指令,才可以(浏览器)翻墙吗 有无更直觉化的方法,比如写一个.sh?

Gzwo avatar Apr 13 '19 14:04 Gzwo

有没有方法开机后能够自动启动全局代理,自己可以手动关闭.就像win上的shadowsocket一样方便啊

ITxiaochong avatar Apr 14 '19 10:04 ITxiaochong

你好,我想问一下,你出现 ProxyChains-3.1 (http://proxychains.sf.net) !!!need more proxies!!! curl: (7) Couldn't connect to server

这个问题你是怎么解决的 ubuntu @ @JaydenSoong

BornTW avatar May 03 '19 06:05 BornTW

ProxyChains-3.1 (http://proxychains.sf.net) /usr/bin/proxychains: 9: exec: google-chrome: not found

why?

ubuntu@ubuntu-MS-7A94:/etc/shadowsocks$ nohup sslocal -c config.json & [2] 22875 ubuntu@ubuntu-MS-7A94:/etc/shadowsocks$ nohup: ignoring input and appending output to '/home/ubuntu/nohup.out'

help!!!!!!!!!!!!!!!!!!!!!

henbucuoshanghai avatar May 17 '19 03:05 henbucuoshanghai

你没有安装谷歌浏览器吧

On Fri, May 17, 2019 at 11:23 AM henbucuoshanghai [email protected] wrote:

ProxyChains-3.1 (http://proxychains.sf.net) /usr/bin/proxychains: 9: exec: google-chrome: not found

why?

ubuntu@ubuntu-MS-7A94:/etc/shadowsocks$ nohup sslocal -c config.json & [2] 22875 ubuntu@ubuntu-MS-7A94:/etc/shadowsocks$ nohup: ignoring input and appending output to '/home/ubuntu/nohup.out'

help!!!!!!!!!!!!!!!!!!!!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/10?email_source=notifications&email_token=AHYQFV7N2HEEPU5AF2DXNXDPVYQM3A5CNFSM4FKMHTQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVTT3FY#issuecomment-493305239, or mute the thread https://github.com/notifications/unsubscribe-auth/AHYQFV5LG4KDMDV6THHFURDPVYQM3ANCNFSM4FKMHTQQ .

realDuYuanChao avatar May 18 '19 15:05 realDuYuanChao

安装好就可以吗?

统统用命令实现翻墙?需要设置别的?

henbucuoshanghai avatar May 19 '19 02:05 henbucuoshanghai

按照视频教程来!没问题的

On Sun, May 19, 2019 at 10:28 AM henbucuoshanghai [email protected] wrote:

安装好就可以吗?

统统用命令实现翻墙?需要设置别的?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shellhub/blog/issues/10?email_source=notifications&email_token=AHYQFV3PGT6U57J3L2WEVQLPWC3M7A5CNFSM4FKMHTQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWZPTY#issuecomment-493721551, or mute the thread https://github.com/notifications/unsubscribe-auth/AHYQFV2IAD2OQ45RN7M2QYDPWC3M7ANCNFSM4FKMHTQQ .

realDuYuanChao avatar May 19 '19 03:05 realDuYuanChao

在成功上一次google后,我也遇到了 need more proxies! 的情况,并且现在无法上google。提示:!!!need more proxies!!! curl: (7) Couldn't connect to server 怎么解决呢

GoniaYen avatar May 25 '19 06:05 GoniaYen

现在好像不能用了

FuChunjin avatar Sep 09 '19 16:09 FuChunjin

现在用不了了吧?

tonyprince6 avatar Nov 05 '19 15:11 tonyprince6

现在用不了了吧?

一直可以的嘛

realDuYuanChao avatar Nov 06 '19 00:11 realDuYuanChao

没事,我现在没用配置文件,找到了一个客户端工具electron-ssr,这个挺好用的。http://www.pianshen.com/article/6177144487/ ------------------ 原始邮件 ------------------ 发件人: "tonyprince6"<[email protected]>; 发送时间: 2019年11月6日(星期三) 凌晨0:01 收件人: "shellhub/blog"<[email protected]>; 抄送: "无进"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [shellhub/blog] 如何在Linux平台下科学上网 (#10)

现在用不了了吧?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BornTW avatar Nov 06 '19 00:11 BornTW

请问配置ssr   只需要ssr链接就可以??? 还是需要输入账号密码端口??

henbucuoshanghai avatar Nov 06 '19 02:11 henbucuoshanghai

我是直接导入链接,方便一点,不会出错。

------------------ 原始邮件 ------------------ 发件人: "henbucuoshanghai"<[email protected]>; 发送时间: 2019年11月6日(星期三) 上午10:36 收件人: "shellhub/blog"<[email protected]>; 抄送: "无进"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [shellhub/blog] 如何在Linux平台下科学上网 (#10)

请问配置ssr&nbsp;&nbsp; 只需要ssr链接就可以??? 还是需要输入账号密码端口?? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BornTW avatar Nov 06 '19 02:11 BornTW

能问一句哪里有ssr?购买?

henbucuoshanghai avatar Nov 07 '19 13:11 henbucuoshanghai

1119006913

henbucuoshanghai avatar Nov 07 '19 14:11 henbucuoshanghai

点击链接加入群聊【免费酸酸乳ssr/3】:https://jq.qq.com/?_wv=1027&k=5LyLBFH 你加这个 QQ 群,可以直接私聊管理员。

------------------ 原始邮件 ------------------ 发件人: "henbucuoshanghai"<[email protected]>; 发送时间: 2019年11月7日(星期四) 晚上9:10 收件人: "shellhub/blog"<[email protected]>; 抄送: "无进"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [shellhub/blog] 如何在Linux平台下科学上网 (#10)

能问一句哪里有ssr?购买? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

BornTW avatar Nov 08 '19 00:11 BornTW

Put config file under /usr/local/etc/proxychains.conf or use proxychains-ng-4.14 instead of proxychains-3.1_2 proxychains-3.1_2 will cause "Segmentation fault" error. on FreeBSD.

rollto avatar Feb 11 '20 10:02 rollto

先收藏

KirkZheng avatar Sep 22 '20 23:09 KirkZheng

看一下这个博客吧,https://phoenix.445600.cf/?p=81

jth445600 avatar Apr 02 '21 09:04 jth445600

你好,我换完源无法定位软件包,后面换了一个好了。连接了镜像 ,连接的镜像不知道对不对。ubuntu20.04ARM虚拟机 m1处理器 虚拟机。 ParallelsDesktop_jb51.dmg 然后就好了。可以下载,但我不知道对不对,

Longhuichen avatar Oct 29 '21 09:10 Longhuichen