-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathss5.sh
60 lines (41 loc) · 1.31 KB
/
ss5.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Update package lists
sudo apt update
# Install dante-server package
sudo apt install dante-server
# Remove default config file
sudo rm /etc/danted.conf
# 获取主要网络接口名称
interface_name=$(ip -o -4 route show to default | awk '{print $5}')
# Create and edit new config file
sudo bash -c "cat <<EOF > /etc/danted.conf
logoutput: syslog
user.privileged: root
user.unprivileged: nobody
# The listening network interface or address.
internal: 0.0.0.0 port=1080
# The proxying network interface or address.
external: $interface_name
# socks-rules determine what is proxied through the external interface.
socksmethod: username
# client-rules determine who can connect to the internal interface.
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
EOF"
# Create unprivileged user account
sudo useradd -r -s /bin/false leishao
# Set password for leishao user
echo -e "leishao\nleishao" | sudo passwd leishao
# Restart danted service
sudo systemctl restart danted.service
# Check status
sudo systemctl status danted.service
# 调用
# wget https://raw.githubusercontent.com/YonQua/YonQua.github.io/main/ss5.sh && chmod +x ss5.sh && ./ss5.sh
# 测试
#curl -v -x socks5://leishao:[email protected]:1080 http://www.google.com/