日踩阿里云ECS两坑:ssh访问佛系 + Ubuntu apt 源sources.list无效

最近阿里云ECS貌似有点不稳定啊,今天踩了两个坑。

一、ssh远程访问有问题

我xshell远程访问时断时续,后来干脆登不上去了,提示错误:

Socket error Event: 32 Error: 10053. Disconnected from remote host

关键我在同一台电脑上使用阿里云提供的网页远程功能却可以远程访问。

网上试了一些方法都没效果,比如有

说IP地址冲突的,修改为固定IP;有说key的权限问题的,重新生成key,并配置权限;有说IP被阿里禁了,怎么可能,web端访问正常;有说没有在ECS安全组里配置端口的,之前都配置了;有说是xshell的问题,换了个putty还是不行;最后连重启大法都试了。无奈,吃了个午饭回来居然神奇般地能远程访问了。到现在我也没弄明白是为什么,真是佛系,希望有踏过类似坑的大佬帮忙解答。

二、更新系统后,apt源出问题

今天用xshell更新了下阿里云ECS系统,提示有更新,强迫症的我就更新了,更新完之后apt的源居然出问题了,

apt-get clean           apt-get update        aptitude update 都用不了了

下面是更新之后的apt源: /etc/apt/sources.list 

  1 ## Note, this file is written by cloud-init on first boot of an instance 
  2 ## modifications made here will not survive a re-bundle. 
  3 ## if you wish to make changes you can: 
  4 ## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg 
  5 ##     or do the same in user-data 
  6 ## b.) add sources in /etc/apt/sources.list.d 
  7 ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl 
  8  
  9 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 
 10 # newer versions of the distribution. 
 11  
 12 deb http://mirrors.cloud.aliyun.com/ubuntu/ bionic main 
 13 deb-src http://mirrors.cloud.aliyun.com/ubuntu/ bionic main 
 14  
 15 ## Major bug fix updates produced after the final release of the 
 16 ## distribution. 
 17 deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates main 
 18 deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates main 
 19  
 20 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
 21 ## team. Also, please note that software in universe WILL NOT receive any 
 22 ## review or updates from the Ubuntu security team. 
 23 deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic universe 
 24 deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic universe 
 25 deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates universe 
 26 deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates universe 
 27                                                                               
 28 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu   
 29 ## team, and may not be under a free licence. Please satisfy yourself as to   
 30 ## your rights to use the software. Also, please note that software in        
 31 ## multiverse WILL NOT receive any review or updates from the Ubuntu          
 32 ## security team.                                                             
 33  deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse              
 34  deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse          
 35  deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse      
 36  deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse  
 37                                                                               
 38 ## Uncomment the following two lines to add software from the 'backports'     
 39 ## repository.                                                                
 40 ## N.B. software from this repository may not have been tested as             
 41 ## extensively as that contained in the main release, although it includes    
 42 ## newer versions of some applications which may provide useful features.     
 43 ## Also, please note that software in backports WILL NOT receive any review   
 44 ## or updates from the Ubuntu security team.                                  
 45  deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse 
 46  deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse 
 47                                                                               
 48 ## Uncomment the following two lines to add software from Canonical's         
 49 ## 'partner' repository.                                                      
 50 ## This software is not part of Ubuntu, but is offered by Canonical and the   
 51 ## respective vendors as a service to Ubuntu users.                           
 52 # deb http://archive.canonical.com/ubuntu xenial partner                      
 53 # deb-src http://archive.canonical.com/ubuntu xenial partner                  
 54                                                                               
 55 #deb http://mirrors.cloud.aliyun.com/ubuntu bionic-security main              
 56 #deb-src http://mirrors.cloud.aliyun.com/ubuntu bionic-security main          
 57 #deb http://mirrors.cloud.aliyun.com/ubuntu bionic-security universe          
 58 #deb-src http://mirrors.cloud.aliyun.com/ubuntu bionic-security universe      
 59 # deb http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security multiverse     
 60 # deb-src http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security multiverse

搞了半天,阿里云的apt源居然打不开 http://mirrors.cloud.aliyun.com/ubuntu/ 

最后换了别的源搞定,这里推荐几个比较好用的吧:

清华大学的源 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

中科大的源 http://mirrors.ustc.edu.cn/

网易的源  http://mirrors.163.com/

完毕!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章