Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说ubuntu1804忘记密码如何重置_ubuntu18忘记密码,希望能够帮助你!!!。
图文结合,手把手教你ubuntu18-live-server-amd64服务器版的安装、配置静态ip以及换源
本文介绍ubuntu18的安装,配置静态ip与dns,换源。之前用centos是真坑啊,感觉有些东西被阉割掉了。ubuntu用起来还挺舒服的。
如果没有ubuntu18-live-server-amd64的可以去下面链接下载,如果失效了评论一下,我再补。
链接:https://pan.baidu.com/s/1gaMHG3FE-8L5KFoW_LQkig?pwd=wxf6
提取码:wxf6
首先在vm上选择好镜像文件,剩下的全都下一步即可 -
-
选择English即可 -
ip暂时不配置,等会进入系统后配置
-
注意这里的intall ssh一定要选择!!!
不选等会换源都要手打具痛苦 -
接下来等待系统的自动安装即可 -
输入下面命令,然后输入当前用户的密码,然后在输入两次你想要的root密码即可
sudo passwd root
root@wxf:/# su root
root@wxf:/# cd /etc/netplan/
root@wxf:/etc/netplan# vi 00-installer-config.yaml
将原来yaml里面的内容替换成下面的内容。ip和网关根据自己的需求换即可
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.109.100/24]
gateway4: 192.168.109.2
nameservers:
addresses: [192.168.109.2,8.8.8.8]
version: 2
使配置生效
root@wxf:/etc/netplan# netplan apply
原因是因为一些安全策略,默认不允许用root连
root@wxf:/# su root
root@wxf:/# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
root@wxf:/# systemctl restart sshd
-
将文件里的内容全部删完,换成下面的清华源。这时使用xshell的好处就出来了,vm不能复制粘贴,自己手打岂不是累死?
root@wxf:/# vi /etc/apt/sources.list
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
更新软件
sudo apt-get update
sudo apt-get upgrade
今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。