67

在Linux系统安装及使用ShellClash的教程

 3 years ago
source link: https://juewuy.github.io/zai-linux-xi-tong-an-zhuang-ji-shi-yong-shellclash-de-jiao-cheng/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

在Linux系统安装及使用ShellClash的教程

发布于 2020-10-20 | 3分钟 | 476字数

支持Debian、CentOS、Ubuntu、Armbian等绝大多数发行版Linux系统下安装及使用本脚本!

使用步骤:

登陆SSH

使用SSH连接工具来登陆SSH,推荐putty(体积最小),JuiceSSH(支持安卓手机),或其他工具,SSH工具请自行下载。

建议使用root用户登录

使用一键脚本安装ShellClash

成功登陆SSH后,直接输入以下命令

~使用curl安装

#github直连
export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
#jsdelivrCDN源
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
复制代码

~使用wget安装

#Release版本-jsdelivrCDN源
export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh  && sh /tmp/install.sh && source /etc/profile &> /dev/null 
复制代码

~非root用户安装后请额外执行以下命令以读取环境变量:

source ~/.bashrc &> /dev/null
复制代码
安装完成后,直接在SSH中使用:
clash
复制代码

命令即可管理脚本!

如果是在虚拟机中用于局域网透明代理

请确保已经开启虚拟Linux系统内置的ip转发功能

使用如下命令判断是否开启ip转发:(返回0代表未开启,1代表已开启)

cat /proc/sys/net/ipv4/ip_forward
复制代码

如尚未开启ip转发,请参考如下教程开启

https://www.linuxprobe.com/ubuntu-ip-forward.html

之后按照新手引导完成配置后即可使用

clash服务成功启动后可以通过在浏览器访问 http://clash.razord.top 或者 https://yacd.haishan.me 或者http://app.tossp.com 来管理clash内置规则以及开启直连访问
访问管理界面时需要提供的Host地址即为你的网关IP地址;端口为9999,密钥为空

问题反馈&使用交流:

https://t.me/clashfm


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK