Linux配置clash客户端

创建配置目录

1
root@cby:~# mkdir /etc/clash

下载主程序

1
2
3
4
5
6
7
8
9
10
11
root@cby:~# wget https://mirrors.chenby.cn/https://github.com/Dreamacro/clash/releases/download/v1.17.0/clash-linux-amd64-v1.17.0.gz--2023-07-01 05:03:15--  https://mirrors.chenby.cn/https://github.com/Dreamacro/clash/releases/download/v1.17.0/clash-linux-amd64-v1.17.0.gz
Resolving mirrors.chenby.cn (mirrors.chenby.cn)... 2606:4700:3032::ac43:86f6, 2606:4700:3031::6815:19fd, 104.21.25.253, ...
Connecting to mirrors.chenby.cn (mirrors.chenby.cn)|2606:4700:3032::ac43:86f6|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3995044 (3.8M) [application/octet-stream]
Saving to: ‘clash-linux-amd64-v1.17.0.gz’

clash-linux-amd64-v1.17.0.gz 100%[==============================================================>] 3.81M 1.06MB/s in 3.6s

2023-07-01 05:03:21 (1.06 MB/s) - ‘clash-linux-amd64-v1.17.0.gz’ saved [3995044/3995044]
root@cby:~#

解压主程序

1
2
3
4
5
root@cby:~# gunzip clash-linux-amd64-*
root@cby:~#
root@cby:~# ls
clash-linux-amd64-v1.17.0
root@cby:~# mv clash-linux-amd64-* /usr/local/bin/clash

配置clash守护进程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@cby:~# chmod +x /usr/local/bin/clash 
root@cby:~# cat > /etc/systemd/system/clash.service << EOF
[Unit]
Description=Clash daemon, A rule-based proxy in Go.
After=network-online.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/clash -d /etc/clash

[Install]
WantedBy=multi-user.target
EOF

设置开机自启并启动

1
2
3
4
systemctl daemon-reload
systemctl enable --now clash
systemctl restart clash
systemctl status clash

下载订阅配置

1
wget 'xxx' -O /etc/clash/config.yaml

启动控制面板

1
docker run -p 1234:80 -d --name yacd --rm ghcr.io/haishanh/yacd:master

关于

https://www.oiox.cn/

https://www.oiox.cn/index.php/start-page.html

CSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客

全网可搜《小陈运维》

文章主要发布于微信公众号