1. ssh连不上,报错:ssh_exchange_identification read connection reset by peer
解决方法:在安全管控->白名单管理->IP白名单添加自己的外网ip。
外网IP可以通过百度ip得到,也可以通过cmd输入curl ifconfig.me得到。
我的是ECS T5, 1核,内存1G,磁盘40G,带宽1M。
2. 在编译gcc9.1的时候会由于内存不够而编译失败。
解决方法:
- 可以增加交换内存:
$ cd /
$ sudo dd if=/dev/zero of=swapfile bs=1M count=3000
To set it as 1GB, change the count value (3000 in the example above) to 1000, 1500 for 1.5GB etc.
Now change the file created to a swap file with the command below.
$ sudo mkswap swapfile
Turn on the swap file with the command,
$ sudo swapon swapfile
To ensure that the swap file is turned on automatically at system startup, open fstab.
$ sudo nano etc/fstab
And add the line given below. Save and close.
/swapfile none swap sw 0 0
That is it. You can check if the system is using the swap file you created with the command
$ cat /proc/meminfo
- make的时候不要使用make -j,不然也会因为内存不够而编译失败。
3. 服务器被ssh暴力破解
解决方法:
1.禁止root用户进行ssh登录
sudo vim /etc/ssh/sshd_config
PermitRootLogin yes 改为 PermitRootLogin no
service sshd restart
2.修改ssh服务端口
sudo vim /etc/ssh/sshd_config
添加Port 1234
service sshd restart
3.登录密码越复杂越好