服务器工具与脚本部署指南
Linux 工具和脚本
Hysteria2 一键安装脚本
Hysteria2 是一个功能强大、速度极快且抗审查的代理工具。它利用定制的 QUIC 协议,在不稳定的网络环境下也能提供卓越的性能,并伪装成标准的 HTTP/3 流量,使其难以被检测和屏蔽。
适用系统: Debian (x86)
安装命令:
wget -N --no-check-certificate https://raw.githubusercontent.com/flame1ce/hysteria2-install/main/hysteria2-install-main/hy2/hysteria.sh && bash hysteria.sh
Windows 客户端:
推荐使用 Nekoray 作为 Windows 平台的客户端。
- Nekoray 下载地址: https://github.com/MatsuriDayo/nekoray/releases/tag/3.26
Socks5 代理一键部署脚本
此脚本可一键自动部署并配置好 Socks5 代理服务。
安装命令:
#!/bin/bash
bash <(curl -sL https://hosting.sunke.info/files/ss5.sh)
默认配置:
- 端口:
8888
- 账号:
8888
- 密码:
8888
X-ui 面板一键部署脚本
X-ui 是一个支持多协议、多用户的 Xray 图形化管理面板,方便用户进行可视化操作。
安装命令:
#!/bin/bash
bash <(curl -Ls https://hosting.sunke.info/files/3x-ui-install.sh)
默认登录信息:
- 用户名:
admin
- 密码:
admin123
- 端口:
65432
iptables 端口转发脚本
这是一个利用 iptables 设置端口转发的便捷脚本,适用于需要进行流量转发的场景。当域名解析的地址发生变化时,它可以自动更新流量转发规则,特别适合 DDNS 域名。
安装与使用:
bash <(curl -fsSL https://raw.githubusercontent.com/arloor/iptablesUtils/master/natcfg.sh)
Windows 初始化脚本 (PowerShell)
该 PowerShell 脚本用于 Windows 系统的快速初始化配置。
功能:
- 创建用户: 新增
user
和sunke
两个用户,密码均为Pass123@
,并将其添加到管理员组。 - 密码策略: 设置
user
、sunke
和Administrator
的密码永不过期。 - 防火墙规则: 开放 TCP 端口
80
,2200
,33899
,65531
的入站和出站规则。 - 软件安装: 自动下载并静默安装最新版的 Firefox 浏览器。
执行代码:
<powershell>
net user user Pass123@ /add
net localgroup administrators user /add
net user sunke Pass123@ /add
net localgroup administrators sunke /add
wmic UserAccount where "Name='user'" set PasswordExpires=FALSE
wmic UserAccount where "Name='sunke'" set PasswordExpires=FALSE
wmic UserAccount where "Name='Administrator'" set PasswordExpires=FALSE
$ports = @(80, 2200, 33899,65531)
foreach ($port in $ports) {
New-NetFirewallRule -DisplayName "TCP Inbound $port" -Direction Inbound -Action Allow -Protocol TCP -LocalPort $port
New-NetFirewallRule -DisplayName "TCP Outbound $port" -Direction Outbound -Action Allow -Protocol TCP -RemotePort $port
}
# 指定 Firefox 64位安装包的下载URL
$sourceURL = "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=zh-CN"
# 指定下载文件的保存路径
$destinationPath = "$env:TEMP\FirefoxInstaller.exe"
Write-Host "正在下载最新64位Firefox安装程序..."
# 使用 Invoke-WebRequest 下载文件
Invoke-WebRequest -Uri $sourceURL -OutFile $destinationPath
Write-Host "下载完成,正在静默安装 Firefox..."
# 以静默模式运行安装程序
Start-Process -FilePath $destinationPath -ArgumentList "/S" -Wait
# 删除下载的安装文件
Remove-Item -Path $destinationPath -Force
Write-Host "Firefox 安装成功!"
</powershell>
<powershellArguments>-ExecutionPolicy Unrestricted -NoProfile -NonInteractive</powershellArguments>
AWS (亚马逊云) 管理脚本
AWS CLI - 添加 IAM 用户
通过此脚本可以快速在您的 AWS 账户中创建一个新的 IAM 用户。
使用方法:
curl -sS https://hosting.sunke.info/awsaimadduser.sh | bash -s -- <用户名> <密码>
示例:
curl -sS https://hosting.sunke.info/awsaimadduser.sh | bash -s -- user Pass123@
AWS Organizations - 创建新账户
此脚本用于在您的 AWS Organization 中创建一个全新的子账户。
使用方法:
curl -sL https://hosting.sunke.info/awsorgcreateuser.sh | bash -s -- <邮箱地址>
示例:
curl -sL https://hosting.sunke.info/awsorgcreateuser.sh | bash -s -- [email protected]