ubuntu 18.04 更新源、ssh

ubuntu 18.04 更新源

  • 1,ubuntu 18.04 LTS 更新源
  • 2,安装ssh

1,ubuntu 18.04 LTS 更新源

vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

2,安装ssh

  • Ubuntu Desktop 默认不会安装ssh服务
# apt-cache search openssh-server
# apt-get install -y openssh-server
  • 设置开机启动ssh
# service ssh status
# systemctl status ssh.service
# systemctl enable ssh
  • ssh容许root远程登陆
# vim /etc/ssh/sshd_config

#Port 22
Port 22
#PermitRootLogin prohibit-password
PermitRootLogin yes
#PasswordAuthentication yes
PasswordAuthentication yes
# systemctl restart ssh.service

参考:

  1. Ubuntu 镜像使用帮助
  2. 如何在Ubuntu 18.04上启用SSH

你可能感兴趣的:(ubuntu)