• Ubuntu最小化安装 (1804版)


    一、Ubuntu最小化安装

    1、修改内核参数,修改网卡名称,将ens33改为eth0

    root@ubuntu:vim /etc/default/grub
    GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
    root@ubuntu:update-grub
    

    2、修改系统的IP地址

    root@node4:~# vim  /etc/netplan/50-cloud-init.yaml
    network:
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          dhcp4: no
          addresses: [192.168.7.110/24]
          gateway4: 192.168.7.2
          nameservers:
                  addresses: [192.168.7.2]
    

     3、应用ip配置并重启测试: 

    root@node4:~# netplan  apply
    

    4、修改apt源仓库/etc/apt/sources.list:1804版本的Ubuntu,参考阿里云仓库:https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.53322f701347Pq

    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src 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-backports main restricted universe multiverse

    5、安装常用命令

    # apt-get update  #更新
    # apt-get purge ufw lxd lxd-client lxcfs lxc-common #卸载不用的包
    # apt-get  install iproute2  ntpdate  tcpdump telnet traceroute nfs-kernel-server nfs-common 
    lrzsz tree  openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute 
    gcc openssh-server lrzsz tree  openssl libssl-dev libpcre3 
    libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute iotop unzip zip
    

    6、重启linux系统,然后做快照即可。  

    # reboot
    

    7、想要root用户登录,先sudo切换到root用户,然后修改ssh服务vim /etc/ssh/sshd_config

    root@node4:~# sudo su
    root@node4:~# vim /etc/ssh/sshd_config
    PermitRootLogin yes  # 允许root用户登录即可
    UseDNS no    # 避免对自己ssh进行反向解析
    
    root@node4:~# systemctl restart sshd   # 重启sshd服务就可以root登录
    

      

      

  • 相关阅读:
    初探动态规划(DP)
    高精度压位
    Poi写文件时报java.io.IOException: Read error
    mysql合并和时间函数
    线程池子线程先执行再执行主线程
    linux常用命令
    使用线程池应该注意的问题
    分页查询千万级数据慢
    待簳的题......
    记录脑残失误,让达摩克利斯之剑永远高悬
  • 原文地址:https://www.cnblogs.com/struggle-1216/p/12212390.html
Copyright © 2020-2023  润新知