Ubuntu 18.04 初始化(server版本 )

  1. 系统安装
    ubuntu 18.04 英文版,创建个人用户

  2. 初始系统
    a.修改ip
    shell> vim /etc/network/interfaces
    auto ens33
    iface ens33 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 202.96.128.86 8.8.8.8
    b. 修改dns
    shell> sed -i '#namserver#i#namserver 202.96.168.86' /etc/resolv.conf (临时修改,重启后清空!)
    以下为永久更改DNS
    shell> vim /etc/resolvconf/resolv.conf.d/base
    nameserver 202.96.128.86
    nameserver 8.8.8.8
    shell> sudo apt-get resolvconf
    shell> sudo resolvconf -u

  3. 开启root用户ssh远程
    shell> sudo apt-get install openssh-server
    修改远程配置文件/etc/ssh/sshd_config
    PermitRootLogin yes
    shell > sudo systemctl restart sshd

  4. 安装必备软件
    sudo apt-get vim net-tools resolvconf systat

  5. 更新
    apt update ---只检查已安装的软件包是否有可用的更新,不更新;
    apt upgrade ---更新已安装的软件包

  6. 修改主机名
    hostnamectl set-hostname ali-sz-xh-172-16-1-59

原文地址:https://www.cnblogs.com/Jack1023/p/10733494.html