搭建环境debian10和ubuntu20,节点类型vless+tls,安装过程无错误提示,也提示安装成功,但就是无法使用该节点正常翻墙。
ssh登录vps后使用systemctl status xray查看xray运行状态,发现xray并未正常启动运行,以下是大致显示的内容:
systemctl status xray
● xray.service - Xray Service Loaded: loaded (/etc/systemd/system/xray.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/xray.service.d └─10-donot_touch_single_conf.conf Active: failed (Result: exit-code) since ----时间-------ago Docs: https://github.com/xtls Process: 9876 ExecStart=/usr/local/bin/xray run -config /usr/local/etc/xray/config.json (code=exited, status=23) Main PID: 9876 (code=exited, status=23)
----时间------- vpsname systemd[1]: Started Xray Service. ----时间------- vpsname xray[9876]: Xray 1.5.5 (Xray, Penetrates Everything.) Custom (go1.18.1 linux/amd64) ----时间------- vpsname xray[9876]: A unified platform for anti-censorship. ----时间------- vpsname xray[9876]: ----时间------- [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/config.json ----时间------- vpsname xray[9876]: Failed to start: main: failed to load config files: [/usr/local/etc/xray/config.json] > invalid UUID: ----时间------- vpsname systemd[1]: xray.service: Main process exited, code=exited, status=23/n/a ----时间------- vpsname systemd[1]: xray.service: Failed with result 'exit-code'.
经排查,可能的原因是由于sudo命令执行异常引起的。因为在命令行中输入sudo命令会出现如下非正常提示unable to resolve host vpsname: Name or service not known。(假设主机名是vpsname,vps主机名可使用hostname命令查看)
root@vpsname:~# sudo sudo: unable to resolve host vpsname: Name or service not known usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...
根据网上找到的解决方案,使用编辑命令修改/etc/hosts
root@vpsname:~# vim /etc/hosts
127.0.0.1 localhost 127.0.1.1 ubuntu 127.0.0.1 vpsname
前两行是原有内容,第三行为添加内容。保存退出后,再执行sudo命令,错误提示消失。
root@vpsname:~# sudo usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...
再使用ProxySu安装vless+tls节点后,能正常翻墙了。 |