使用阿里云遇到的问题记录

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的时候会由于内存不够而编译失败。

解决方法:

  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

设置交换内存

  1. 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.登录密码越复杂越好

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值