# 更改apt源 cat > /etc/apt/sources.list <<'END' #阿里雲 deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse END
# 更新源和軟件
sudo apt-get update -y sudo apt-get upgrade -y sudo apt update && sudo apt upgrade -y
vi /etc/ssh/sshd_config # 默認是22端口,如果和windows端口沖突或你想換成其他的否則不用動 Port = 22 # 如果需要指定監聽的IP則去除最左側的井號,並配置對應IP,默認即監聽PC所有IP ListenAddress 0.0.0.0 # 如果你需要用 root 直接登錄系統則此處改為 yes PermitRootLogin yes # 將 no 改為 yes 表示使用帳號密碼方式登錄 PasswordAuthentication yes # 安裝ssh並開啟 apt autoremove openssh-server sudo apt-get install openssh-client=1:6.6p1-2ubuntu2.13 -y apt-get install openssh-server -y service ssh restart