图文结合,手把手教你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新建虚拟机
首先在vm上选择好镜像文件,剩下的全都下一步即可 –
–




系统安装
选择English即可 –








ip暂时不配置,等会进入系统后配置
–
















注意这里的intall ssh一定要选择!!!
不选等会换源都要手打具痛苦 –




接下来等待系统的自动安装即可 –








一些配置
配置root账号的密码
输入下面命令,然后输入当前用户的密码,然后在输入两次你想要的root密码即可
sudo passwd root
配置ip与dns
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
解决xshell不能用root用户连服务器ssh
原因是因为一些安全策略,默认不允许用root连
root@wxf:/# su root
root@wxf:/# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
root@wxf:/# systemctl restart sshd
使用xshell连接服务器




–








换源
将文件里的内容全部删完,换成下面的清华源。这时使用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
2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/8472.html