以前用过搬瓦工的VPS,但是IP老是被ban就不用了,现在平常都用机场,不过机场又怕跑路,所以还是整个便宜的VPS做备用。

当前(20220831)RakNerd洛杉矶DC02有上货,就买了个玩玩,太久没玩VPS了,这里记录下备忘。

RackNerd补货套餐

E5

AMD Ryzen Linux VPS

测试IP:204.13.154.3
LG:http://lg-lax02.racknerd.com/

开机到科学上网配置

以我买的的E5/1G/1核为例,系统安装Debian10。

1
2
3
4
5
6
OS: Debian GNU/Linux 10 (buster) x86_64
Host: KVM RHEL 7.6.0 PC (i440FX + PIIX, 1996)
Kernel: 4.19.0-6-amd64
CPU: Intel Xeon E5-2690 v2 (1) @ 2.999GHz
GPU: Cirrus Logic GD 5446
Memory: 96MiB / 987MiB

更新

拿到服务器后第一件事,先更新软件源(root登录)。

1
apt update -y

安装sudo

1
apt install sudo

创建sudo用户

当然直接用root用户也行,反正玩坏了就重装,一般还是新建个用户玩。

1
2
3
4
5
6
# username 写自己想要的用户名
# 按照提示设置密码和个人信息
adduser username

# 加sudo权限
usermod -aG sudo username

ssh登录

在本地将公钥传到服务器上:

1
scp id_rsa.pub username@ip:/home/akari/

服务器上看到后写进~/.ssh/authorized_keys

1
cat id_rsa.pub >> ~/.ssh/authorized_keys

命令别名

比如设置ll命令

1
2
3
4
5
6
# 编辑
vi /etc/profile
# 底部添加想要的别名命令
alias ll='ls -l'
# 刷新
soure /etc/profile

开启bbr

GitHub搜下用别人的脚本。

1
2
3
wget --no-check-certificate -O /opt/bbr.sh https://github.com/teddysun/across/raw/master/bbr.sh
chmod 755 /opt/bbr.sh
/opt/bbr.sh

成功并查看信息 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---------- System Information ----------
OS : Debian GNU/Linux 10
Arch : x86_64 (64 Bit)
Kernel : 4.19.0-6-amd64
----------------------------------------
Automatically enable TCP BBR script

URL: https://teddysun.com/489.html
----------------------------------------

Press any key to start...or Press Ctrl+C to cancel

[Info] The kernel version is greater than 4.9, directly setting TCP BBR...
[Info] Setting TCP BBR completed...
root@racknerd-e6af81:~# uname -r
4.19.0-6-amd64
root@racknerd-e6af81:~# lsmod | grep bbr
tcp_bbr 20480 9


root@racknerd-e6af81:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic bbr

xray

也是用的GitHub别人的脚本。

1
wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh

按照提示需要填域名和设置uuid。域名先到域名服务商把域名指向VPS的IP;得到一个uuid很简单,直接在服务器输入python3进入python命令行写两行代码就行,如下:

1
2
3
4
5
6
7
8
akari@racknerd-e6af81:~$ python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uuid
>>> print(uuid.uuid4())
623050c8-594f-411a-9a3a-b2ddb8d7d4cd
>>>

其他xray的其他配置都是自动,等待脚本执行完成,最后会输出各种账号信息,需要什么协议的复制对应信息到小火箭就能用了。