Linux使用shadowsocks客户端进行代理上网

原创 sauren  2019-08-29 16:00  阅读 471 views 次 评论 31 条

国内的服务器基本有一些软件源是需要从国外进行下载,有时候速度奇慢无比,这个时候需要在服务器上翻墙扶一下,保证速度。

首先需要服务器安装了python  和python-pip这两个包。

安装shadowsocks
pip install shadowsocks

注意,如果后续步骤出现shadowsocks版本低的错误,可以使用

pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U

直接从github拉取最新的代码进行使用。

配置客户端
vim /etc/shadowsocks.json 

{
"server":"*.*.*.*", #ss服务器IP
"server_port":*, #端口
"local_address": "127.0.0.1", #本地ip
"local_port":1080, #本地端口
"password":"*",#连接ss密码
"timeout":300, #等待超时
"method":"chacha20-ietf-poly1305", #加密方式
"fast_open": false, # true 或 false。如果你的服务器 Linux 内核在3.7+,可以开启 fast_open 以降低延迟。开启方法: echo 3 > /proc/sys/net/ipv4/tcp_fastopen 开启之后,将 fast_open 的配置设置为 true 即可
"workers": 1 # 工作线程数
}

相关配置要填入你已经配置好了的shadowsocks服务端信息。

启动
sslocal  -c /etc/shadowsocks.json

由于shadowsocks是socks5代理,服务器上不能直接将http的代理使用,所以需要privoxy ,将全局的http,https等代理到socks5。

安装privoxy
apt install privoxy
配置privoxy
vi /etc/privoxy/config

forward-socks5t   /               127.0.0.1:1080 .  
listen-address  127.0.0.1:8118

vi /etc/profile

export http_proxy=http://127.0.0.1:8118  
export https_proxy=http://127.0.0.1:8118  
export ftp_proxy=http://127.0.0.1:8118

重启服务即可。

serivce privoxy restart
source /etc/profile

 

 

本文地址:https://www.sk15.net/archives/304.html
版权声明:本文为原创文章,版权归 sauren 所有,欢迎分享本文,转载请保留出处!
高性能云服务器特惠

发表评论


表情

  1. Louishor
    Louishor @回复

    Nicely put. Cheers! canadian pharmacies online prescriptions

  2. Tyronemox
    Tyronemox @回复

    Nicely put. Regards! https://viagradjango.com/

  3. RichardDearp
    RichardDearp @回复

    Many thanks, I like it. american eagle cbd

  4. RichardDearp
    RichardDearp @回复

    You mentioned this wonderfully. hemp oil for pain

  5. Lesloardy
    Lesloardy @回复

    Propecia Facial Hair Achat Generique Cialis generic cialis overnight delivery Cialis Anwendung Dosierung Cytotec Prix Senegal Cialis J En Ai Pris

  6. Larrytus
    Larrytus @回复

    Fantastic posts, Thanks a lot! Augmentin Rx

  7. ErnestLip
    ErnestLip @回复

    Regards. Lots of knowledge!
    inderal medication

  8. Louishor
    Louishor @回复

    You revealed that superbly. canadian viagra

  9. Lesloardy
    Lesloardy @回复

    Buy Valacyclovir Dosage For Shingles Biaxin 500 Mg Amoxil 500 Mg Prix De Levitra En Pharmacie Cialis Forum Viagra 50mg Purple Pharmacy Algodones Mexico

  10. Larrytus
    Larrytus @回复

    You suggested this adequately! methocarbamol

  11. ErnestLip
    ErnestLip @回复

    Wow plenty of excellent facts! keflex generic

  12. RichardDearp
    RichardDearp @回复

    Kudos! An abundance of facts.
    https://viagrapython.com/

  13. Louishor
    Louishor @回复

    Thanks, A good amount of forum posts.
    modafinil vs adderall

  14. Larrytus
    Larrytus @回复

    Many thanks. A lot of material!
    Doxycycline And Dry Eyes

  15. RichardDearp
    RichardDearp @回复

    Appreciate it, Ample content.
    highest rated canadian pharmacies

  16. Larrytus
    Larrytus @回复

    Truly plenty of beneficial data! hydrochloride medication

  17. RichardDearp
    RichardDearp @回复

    Thanks! Great stuff! online pharmacies canada

  18. Larrytus
    Larrytus @回复

    Appreciate it! Quite a lot of knowledge.
    canada pharmacy

  19. Larrytus
    Larrytus @回复

    You have made the point! Baclofen 10 Mg Bid

  20. Stevintota
    Stevintota @回复

    Acheter Cytotec En France Propecia For Sale Pharmacy Zithromax Special Instructions cialis Priligy Hilft Tamoxifen

  21. Larrytus
    Larrytus @回复

    Lovely forum posts, Thanks! z pack antibiotic

  22. MatVory
    MatVory @回复

    Comprar Levitra Bucodispersable Cialis Cialis 5mg Filmtabletten 28 Stuck Preis Cialis Tablettes Clomid Allaitement Medicaments

  23. Lesloardy
    Lesloardy @回复

    Discount Doxycycline Buy Marque Commander Cialis Kamagra Viagra Generika Cialis Canadian Drugs Cialis Generique En Ligne

  24. Larrytus
    Larrytus @回复

    You made the point! generic advair

  25. MatVory
    MatVory @回复

    Cialis Equivalent Viagra Comprare Levitra 10 Mg Buy Levitra Online Uk No Prescription cialis 5 mg Keflex Hallucination Buy Bactroban Uk Viagra Et Cialis

  26. Larrytus
    Larrytus @回复

    Point well regarded.! Ciprofloxacin Eye Drops .3% Cause Yeast Infections

  27. Larrytus
    Larrytus @回复

    Amazing quite a lot of good facts! Bactrim Prescription Uti

  28. KelSpipsy
    KelSpipsy @回复

    Free Ed Medicine Samples Generic isotretinoin drugs by money order overseas no rx Cialis Tadalafil Canadian Pharmacy Online Tadalafil Online Reliable

  29. Larrytus
    Larrytus @回复

    Cheers, Quite a lot of information!
    Bijsluiter Van Cialis

  30. Larrytus
    Larrytus @回复

    Wow loads of amazing tips! celebrex 200 mg

  31. Larrytus
    Larrytus @回复

    Regards, Wonderful information! Promethazine Adverse Drug Reaction