Erlo

使用KubeAdm部署Kubernetes集群——如何访问google代码仓库及Yum源

收藏 2018-11-22 22:00:14   1542   博客园
页面报错/反馈
点赞

一、申请国外服务器,部署ShadowSock服务

1、下载并创建配置文件

wget https://github.com/shadowsocks/shadowsocks-go/releases/download/1.2.1/shadowsocks-server.tar.gz
tar -zxf shadowsocks-server.tar.gz
cd shadowsocks-server
cat > config.json <<EOF
{
    "server":"127.0.0.1",
    "server_port":8888,
    "local_port":1080,
    "local_address":"127.0.0.1",
    "password":"yourpassword",
    "method": "aes-256-cfb",
    "timeout":600
}
EOF

2、打开防火墙对应端口

systemctl status firewalld
firewall-cmd --permanent --zone=public --add-port=8888/tcp
firewall-cmd --permanent --zone=public --add-port=8888/udp
firewall-cmd --reload

3、设置自启动

cat > /lib/systemd/system/shadowsocks.service <<EOF
[Unit]
Description=ShadowSocksServer
After=network.target

[Service]
ExecStart=/shadowsocks-server/shadowsocks-server -c /shadowsocks/config.json  >>shadowsocks-`date +%Y-%m`.log &
ExecStop=kill -9 `ps -au | grep -v grep |grep shadowsocks-server | awk '{print $2}'`  >>shadowsocks-`date +%Y-%m`.log

[Install]
WantedBy=multi-user.target
EOF

systemctl start shadowsocks
systemctl enable shadowsocks

二、安装客户端

yum install python-pip
pip install shadowsocks
pip install --upgrade pip
pip install shadowsocks
cat > /etc/shadowsocks.json  <<EOF
{
"server":"yourserver",
"server_port":8888,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"yourpassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
EOF

sslocal -c /etc/shadowsocks.json -d start
#sslocal -c /etc/shadowsocks.json -d stop

三、安装socket5转http代理工具

yum install privoxy
echo forward-socks5 / 127.0.0.1:1080 . >> /etc/privoxy/config
systemctl restart privoxy

四、启用或停用全局http/https代理

export http_proxy=http://localhost:8118
export https_proxy=https://localhost:8118

#unset http_proxy
#unset https_proxy

五、使用更灵活的代理方式

yum -y install gcc
wget http://ftp.barfooze.de/pub/sabotage/tarballs/proxychains-ng-4.13.tar.xz
tar -xvf proxychains-ng-4.13.tar.xz
cd proxychains-ng-4.13
./configure 
make && make install
cp ./src/proxychains.conf /etc/proxychains.conf 
vi /etc/proxychains.conf 
#将socks4 127.0.0.1 9095改为socks5 127.0.0.1 1080

用法:在需要代理的命令前加上 proxychains4 ,如:proxychains4 curl www.google.com

 

登录查看全部

参与评论

评论留言

还没有评论留言,赶紧来抢楼吧~~

返回顶部

给这篇文章打个标签吧~

棒极了 糟糕透顶 好文章 PHP JAVA JS 小程序 Python SEO MySql 确认