找回密码
 立即注册
搜索
热搜: 中医 针灸 咳嗽
查看: 101|回复: 0

一键搭建SOCKS5代理

[复制链接]

3706

主题

1

回帖

1万

积分

管理员

积分
11870
发表于 2024-3-7 16:39:16 | 显示全部楼层 |阅读模式
  • 首先,编译安装SS5需要先安装一些依赖组件


wget --no-check-certificate https://raw.github.com/Lozy/danted/master/install.sh -O install.sh bash install.sh
bash install.sh --port=443 --user=slobys --passwd=123456


[Python] 纯文本查看 复制代码
#!/bin/bash
#
#   Dante Socks5 Server AutoInstall
#   -- Owner:       [url]https://www.inet.no/dante[/url]
#   -- Provider:    [url]https://sockd.info[/url]
#   -- 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



您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|私人站点 ( 冀ICP备2023028127号-2 )

GMT+8, 2025-4-19 12:04 , Processed in 0.090781 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表