1.通过浏览器,点击ssh连接
2.切换root,
sudo -i
3.设置PasswordAuthentication为yes, 去掉前面的#号(如果有的话)
vim /etc/ssh/sshd_config
PasswordAuthentication yes
ChallengeResponseAuthentication yes (部分机器需要配置为yes)
4.重启ssh服务
sudo systemctl restart ssh
5、修改登录账号的密码(例如我的登录账号就是ubuntu)
passwd ubuntu
6.安装hysteria
7.配置hysteria
# listen: :443
acme:
domains:
- 你的域名
email: your@email.com
auth:
type: password
password: 设置你的密码
masquerade:
type: proxy
proxy:
url: https://news.ycombinator.com/
rewriteHost: true
8、操作hysteria
启动hysteria
systemctl start hysteria-server.service
重启hysteria
systemctl restart hysteria-server.service
查看状态
systemctl status hysteria-server.service
9、客户端配置模板
server:
你的域名:443
auth:
你的密码
bandwidth:
up: 20 mbps
down: 60 mbps
tls:
sni: 你的域名
insecure: false #使用自签时需要改成true
socks5:
listen: 127.0.0.1:1080
http:
listen: 127.0.0.1:8080
10.手机客户端配置文件
{
"dns": {
"servers": [
{
"tag": "cf",
"address": "https://1.1.1.1/dns-query"
},
{
"tag": "local",
"address": "223.5.5.5",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
{
"geosite": "category-ads-all",
"server": "block",
"disable_cache": true
},
{
"outbound": "any",
"server": "local"
},
{
"geosite": "cn",
"server": "local"
}
],
"strategy": "ipv4_only"
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"strict_route": false,
"sniff": true
}
],
"outbounds": [
{
"type": "hysteria2",
"tag": "proxy",
"server": "你的对应服务器的域名",
"server_port": 443,
"up_mbps": 20,
"down_mbps": 200,
"password": "密码",
"tls": {
"enabled": true,
"server_name": "你的对应服务器的域名",
"insecure": false
}
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": "cn",
"geoip": [
"private",
"cn"
],
"outbound": "direct"
},
{
"geosite": "category-ads-all",
"outbound": "block"
}
],
"auto_detect_interface": true
}
}
没有评论:
发表评论