Oracle-Cloud服务器Ubuntu系统的初始化配置,并搭建X-ray代理服务

初始化操作

  • 开启root登录:

    ~$ sudo su
    
    ~$ vim /root/.ssh/authorized_keys
    	把ssh-rsa之前的文件都删除掉(不删除‘ssh-rsa’)
    
    ~$ vim /etc/ssh/sshd_config
    	找到 PermitRootLogin
    	添加 PermitRootLogin yes
    
    ~$ reboot
    
  • 防火墙设置:

    ~$ iptables -P INPUT ACCEPT
    ~$ iptables -P FORWARD ACCEPT
    ~$ iptables -P OUTPUT ACCEPT
    ~$ iptables -F
    ~$ apt-get purge netfilter-persistent
    
    ~$ reboot
    
  • 配置BBR加速:

    ~$ echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
    ~$ echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
    ~$ sysctl -p
    ~$ lsmod | grep bbr
    

    打完最后一步,应看到 20480 或 16384 说明BBR开启成功

申请SSL证书:

  • 安装依赖包

    ~$ apt update -y
    ~$ apt install -y curl
    ~$ apt install -y socat
    
  • 申请证书

    ~$ curl https://get.acme.sh | sh
    ~$ ~/.acme.sh/acme.sh --register-account -m <邮箱>
    ~$ ~/.acme.sh/acme.sh --issue -d <域名> --standalone
    ~$ ~/.acme.sh/acme.sh --installcert -d <域名> --key-file /root/private.key --fullchain-file /root/cert.crt
    

    完成后,root目录下看到证书公钥/root/cert.crt及密钥文件/root/private.key

配置Xray-ui界面

参考
项目地址

  • 安装:

    ~$ bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
    
    账户名: *****
    设置密码: *********
    访问端口: 2048(随意选)
    
  • 登录: domain: port

  • 进入’面板设置’:

    添加'公钥路径' -> /root/cert.crt
    添加'私钥路径' -> /root/private.key
    点击'重启面板'
    
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值