重要目录和文件
- V2Ray 二进制文件:
/usr/local/bin/v2ray - 数据文件(geoip、geosite):
/usr/local/share/v2ray/ - 日志:
/var/log/v2ray/ - 服务器配置:
/usr/local/etc/v2ray/config.json - 客户端配置
/root/client.json(SOCKS5 上127.0.0.1:1080) - VMESS 分享 URL:
/root/client.vmess(Base64 编码,可导入 V2Ray 客户端)
管理服务
systemctl start v2ray # Start service
systemctl stop v2ray # Stop service
systemctl restart v2ray # Reload configs
systemctl status v2ray # Show status
journalctl -u v2ray -f # Live logs
如何连接
方式 A:使用客户端配置(client.json)
1. 复制 /root/client.json 到本地机器。
2. 在本地运行 V2Ray:
v2ray run -config client.json
3. 配置浏览器或系统,使用 SOCKS5 代理:
Host: 127.0.0.1
Port: 1080
方式 B:使用 VMESS URL
1. 打开 /root/client.vmess 并复制 URL。
2. 将其导入客户端应用。
编辑配置
服务器配置: /usr/local/etc/v2ray/config.json
修改示例:更改端口 10086 → 443 以提升防火墙穿透能力。
编辑后:
systemctl restart v2ray
安全提示
- 这是一个非常基础的演示配置,进阶用户需自行配置并加固。
- 使用域名 + TLS(通过 Nginx + certbot)以提高隐蔽性。
- 请妥善保管 UUID,如需重新生成,运行:
v2ray uuid