Linux安装并使用ssr客户端

1,091次阅读
没有评论

共计 1547 个字符,预计需要花费 4 分钟才能阅读完成。

引子

也许是使用Linux的大佬都不屑于写这么简单的教程吧,所以关于如何在Linux上安装使用ssr客户端的教程比较少又比较模糊。

所以我就来写这个教程吧,同时因为Linux克隆GitHub的仓库奇慢并且可能会出现超时的情况(在此感谢GFW),文中及脚本的Git仓库均位于我自己搭建的gogs

安装

首先确认一下自己自己安装了Git。

ubuntu

sudo apt-get install git

Centos

sudo yum install git

然后在具有写权限的目录执行如下命令获取到ssr脚本仓库

git clone http://git.mrwang.pw/Reed/Linux_ssr_script.git

进入刚刚克隆的仓库目录并赋予ssr脚本执行权限

cd Linux_ssr_script && chmod +x ./ssr

然后将脚本放入可执行脚本的目录

sudo mv ./ssr /usr/local/sbin/

这样就完成了脚本的安装

使用

输入ssr,便会有如下的提示:

ShadowSocksR python client tool
if you have not installed ssr, run `ssr install` first
Usage:
	 ssr help Install/Uninstall
	 ssr install install shadowsocksr client
	 ssr uninstall    uninstall shadowsocksr client

 Config and Subscribe
	 ssr update       update subscription from http://ss.pythonic.life
	 ssr config       edit config.json
	 ssr xclip        paste configs from clipboard to config.json

 Start/Stop/Restart
	 ssr start        start the shadowsocks service
	 ssr stop         stop the shadowsocks service
	 ssr restart      restart the shadowsocks service

 Testing and Maintenance
	 ssr test get ip from cip.cc using socks5 proxy
	 ssr log          cat the log of shadowsocks
	 ssr shell        cd into ssr installation dir ssr clean        clean ssr configuration backups

我们是第一次使用,所以首先执行

ssr install 

脚本它会下载ssr客户端并移动到合适的位置,现在我们来编辑配置文件

ssr config

在里面输入你的节点连接信息,然后保存。

启动

现在,来启动ssr进行哲学上网吧!

ssr start

关闭

关闭ssr可以输入

ssr stop

安装privoxy

Linux貌似默认不支持直接使用socks代理,使用privoxy将socks5转换为http代理

# yum install -y privoxy
  • 1

配置privoxy

# vim /etc/privoxy/config
  • 1

末尾增加下面内容,/后面是代理服务器的地址:端口,注意最后还有个.

forward-socks5t / x.x.x.x:10808 .
  • 1

启动服务

# systemctl start privoxy
  • 1

设置一下系统代理变量

# export all_proxy=http://127.0.0.1:8118
# export http_proxy=http://127.0.0.1:8118
# export https_proxy=http://127.0.0.1:8118

注:8118是privoxy默认使用的端口

测试一下

# curl ifconfig.io
  • 1

查看IP地址已经变成代理服务器的地址了.

正文完
 
admin
版权声明:本站原创文章,由 admin 2020-07-31发表,共计1547字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码