zoukankan      html  css  js  c++  java
  • 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登录
    

      

      

  • 相关阅读:
    Windows 8将替换Win32 API
    密码强度检测:passwordStrength
    整数溢出与程序安全
    编程经验谈:如何正确使用内存
    C/C++指针学习的两个经典实例
    VC调试入门
    一些电子书籍的网站
    BMP文件格式分析(zz)
    C/C++ 跨平台I/O操作技巧
    Windows下C语言网络编程快速入门
  • 原文地址:https://www.cnblogs.com/struggle-1216/p/12212390.html
Copyright © 2011-2022 走看看