• 图文结合,手把手教你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
    
    • 1
    • 2

    安装

    vm新建虚拟机

    首先在vm上选择好镜像文件,剩下的全都下一步即可

    • 在这里插入图片描述
    • 在这里插入图片描述

    系统安装

    选择English即可

    • 在这里插入图片描述

    • 在这里插入图片描述

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

    • 在这里插入图片描述

    • 在这里插入图片描述

    • 在这里插入图片描述

    • 在这里插入图片描述

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

    • 在这里插入图片描述

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

    • 在这里插入图片描述

    • 在这里插入图片描述

    一些配置

    配置root账号的密码

      输入下面命令,然后输入当前用户的密码,然后在输入两次你想要的root密码即可

    sudo passwd root
    
    • 1

    配置ip与dns

    root@wxf:/# su root
    root@wxf:/# cd /etc/netplan/
    root@wxf:/etc/netplan# vi 00-installer-config.yaml
    
    • 1
    • 2
    • 3

      将原来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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

      使配置生效

    root@wxf:/etc/netplan# netplan apply
    
    • 1

    解决xshell不能用root用户连服务器ssh

      原因是因为一些安全策略,默认不允许用root连

    root@wxf:/# su root
    root@wxf:/# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
    root@wxf:/# systemctl restart sshd
    
    • 1
    • 2
    • 3

    使用xshell连接服务器

    • 在这里插入图片描述- 在这里插入图片描述

    • 在这里插入图片描述

    换源

      将文件里的内容全部删完,换成下面的清华源。这时使用xshell的好处就出来了,vm不能复制粘贴,自己手打岂不是累死?

    root@wxf:/# vi /etc/apt/sources.list
    
    • 1
    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

      更新软件

    sudo apt-get update
    sudo apt-get upgrade
    
    • 1
    • 2
  • 相关阅读:
    干洗店管理系统洗鞋店预约上门小程序洗护流程;
    Nautilus Chain全球行分享会,上海站圆满举办
    Redis哨兵模式
    docker常用命令
    好的FPGA编码风格(1)--尽量避免组合逻辑环路(Combinational Loops)
    解决Java应用程序中的SQLSyntaxErrorException:Unknown database错误
    【ETL】常见的ETL工具(含开源及付费)一览和优劣势分析?
    基于qt的图书管理系统----04sql功能开发
    puzzle(018.4)珍珑棋局
    Flink---14、Flink SQL(SQL-Client准备、流处理中的表、时间属性、DDL)
  • 原文地址:https://blog.csdn.net/qq_42956653/article/details/126063534