說(shuō)明
Socks5
屬于明文代理,不要用于科學(xué)上網(wǎng),否則會(huì)被阻斷端口,可用于正常的跳板使用;
比如SSH
轉(zhuǎn)發(fā)加速國(guó)外VPS
的連接速度,特別是一些延遲高或者丟包高的VPS
;
使用Socks5
轉(zhuǎn)發(fā)后SSH
就可以快速穩(wěn)定的連接了,解決高丟包SSH
斷開(kāi)的問(wèn)題;
支持
支持系統(tǒng)
Debian7+
?Ubuntu14.04+
?CentOS6+
安裝
下載腳本
wget --no-check-certificate https://raw.github.com/Lozy/danted/master/install.sh -O install.sh
?https://raw.github.com/Lozy/danted/master/install.sh
#!/bin/bash
#
# Dante Socks5 Server AutoInstall
# -- Owner: https://www.inet.no/dante
# -- Provider: https://sockd.info
# -- Author: Lozy
#
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install"
exit 1
fi
REQUEST_SERVER="https://raw.github.com/Lozy/danted/master"
SCRIPT_SERVER="https://public.sockd.info"
SYSTEM_RECOGNIZE=""
[ "$1" == "--no-github" ] && REQUEST_SERVER=${SCRIPT_SERVER}
if [ -s "/etc/os-release" ];then
os_name=$(sed -n 's/PRETTY_NAME="\(.*\)"/\1/p' /etc/os-release)
if [ -n "$(echo ${os_name} | grep -Ei 'Debian|Ubuntu' )" ];then
printf "Current OS: %s\n" "${os_name}"
SYSTEM_RECOGNIZE="debian"
elif [ -n "$(echo ${os_name} | grep -Ei 'CentOS')" ];then
printf "Current OS: %s\n" "${os_name}"
SYSTEM_RECOGNIZE="centos"
else
printf "Current OS: %s is not support.\n" "${os_name}"
fi
elif [ -s "/etc/issue" ];then
if [ -n "$(grep -Ei 'CentOS' /etc/issue)" ];then
printf "Current OS: %s\n" "$(grep -Ei 'CentOS' /etc/issue)"
SYSTEM_RECOGNIZE="centos"
else
printf "+++++++++++++++++++++++\n"
cat /etc/issue
printf "+++++++++++++++++++++++\n"
printf "[Error] Current OS: is not available to support.\n"
fi
else
printf "[Error] (/etc/os-release) OR (/etc/issue) not exist!\n"
printf "[Error] Current OS: is not available to support.\n"
fi
if [ -n "$SYSTEM_RECOGNIZE" ];then
wget -qO- --no-check-certificate ${REQUEST_SERVER}/install_${SYSTEM_RECOGNIZE}.sh | \
bash -s -- $* | tee /tmp/danted_install.log
else
printf "[Error] Installing terminated"
exit 1
fi
exit 0
安裝腳本
bash install.sh --port=端口 --user=用戶名 --passwd=密碼
其中的端口
?用戶名
?密碼
自行修改后粘貼到SSH
里運(yùn)行安裝即可;
完成后會(huì)提示Dante Server Install Successfuly
即表示安裝成功;
安裝后如果連接不上,檢查設(shè)置的端口是否已經(jīng)放行;
說(shuō)明:安裝完成后會(huì)顯示內(nèi)網(wǎng)IP地址,但在實(shí)際使用的時(shí)候需要用外網(wǎng)IP地址;
使用
一般使用IP
和用戶名密碼即可使用
如果需要固定IP或IP段,可以修改配置文件設(shè)置白名單
vi /etc/danted/sockd.conf
修改以下代碼,改成你需要設(shè)置的白名單IP或IP段即可,然后重啟使其生效;
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
卸載
bash install.sh --uninstall
命令
命令 | 或者 | 說(shuō)明 |
---|---|---|
service sockd start | /etc/init.d/sockd start | 啟動(dòng)socks5服務(wù)器守護(hù)進(jìn)程 |
service sockd stop | /etc/init.d/sockd stop | 停止socks5服務(wù)器守護(hù)進(jìn)程 |
service sockd restart | /etc/init.d/sockd restart | 重新啟動(dòng)socks5服務(wù)器守護(hù)進(jìn)程 |
service sockd reload | /etc/init.d/sockd reload | 重新加載socks5服務(wù)器守護(hù)進(jìn)程 |
service sockd status | / | 系統(tǒng)進(jìn)程狀態(tài) |
service sockd state | /etc/init.d/sockd state | 運(yùn)行狀態(tài) |
service sockd tail | /etc/init.d/sockd tail | sock 日志 |
service sockd adduser | /etc/init.d/sockd adduser | 添加pam-auth用戶:service sockd adduser NAME PASSWORD |
service sockd deluser | /etc/init.d/sockd deluser | 刪除pam-auth用戶:service sockd deluser NAME |
使用Proxifier工具代理?文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-487630.html
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-487630.html
到了這里,關(guān)于Ubuntu/Debian/CentOS搭建Socks5代理一鍵腳本的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!