一、Ubuntu换源
1.备份原始源文件source.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bankup
2.修改源文件sources.list
将下面任意一个内容替换到sources.list文件中
阿里源
#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
清华源
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
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
3.保存并退出
4.执行下面两条命令来更新和升级源
apt update
apt upgrade
二、安装sshd服务,从而能够远程连接
1.首先安装openssh-server
apt install openssh-server
2.启动sshd服务
systemctl restart sshd
三、远程连接时,不能使用root用户登录
1.修改/etc/ssh/sshd_config
文件把PermitRootLogin Prohibit-password
添加#
注释掉(默认就是注释掉的)
2.新添加:PermitRootLogin yes
3.重启ssh服务 /etc/init.d/ssh restart
4.使用root远程连接Ubuntu
四、安装VMtools,否则不能从Windows上复制粘贴东西到Ubuntu上。
1.安装vmtools
安装之后,Ubuntu桌面上会出现如下内容
2.双击进入上面的vmtools,然后使用root用户解压如下文件
命令如下
3.进入解压的目录,然后执行vmware-install.pl脚本。(在执行脚本过程中,除了第一个提示需要输入yes外,其他提示全部enter就行了)
4.重启虚拟机
五、ifconfig命令无法使用
apt install net-tools