1.一、查看版本:cat /etc/redhat-release
yum install net-tools || apt install net-tools (ifconfig 查看鏈接網絡,使用secureCRT鏈接 eth0的inet )
yum install -y wget
2.3.1:切換到centos的yum源:cd /etc/yum.repos.dcentos
2.3.2:備份原來的repo文件:mv CentOs-Base.repo CentOs-Base.repo.bakbash
2.3.3:下載阿里雲的repo文件:wget http://mirrors.aliyun.com/repo/Centos-7.repo服務器
2.3.4:替換原來的repo文件:mv Centos-7.repo CentOs-Base.repo網絡
2.3.5:依次執行yum源更新命令: ①yum clean all ② yum makecache ③ yum updatessh
四、 Debian9配置阿里雲源阿里雲
-4.一、在Windows建立「sources.list」文件,內容爲spa
deb http://mirrors.aliyun.com/debian stretch main contrib non-free deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free-4.二、用建立「sources.list」替換「/etc/apt/sources.list」 ,命令:mv /root/sources.list /etc/apt/sources.listrest
-4.三、更新鏡像:apt-get updatecode
五、Debian 9 開啓ssh資源
-5.一、更新apt資源列表:apt-get update
-5.二、安裝openssh服務器:apt-get install openssh-service
-5.三、啓用ssh.service:systemctl start ssh.service
-5.四、修改配置: vi /etc/ssh/sshd_config 將 #PermitRootLogin prohibit-password 改成 PermitRootLogin yes 和將 #port 22的「#」號刪除
-5.五、重啓ssh:/etc/init.d/ssh restart
-5.六、設置開機自啓:update-rc.d ssh enable
-5.七、關閉自啓:update-rc.d ssh disabled(需重啓)