linux common summary

yum download dependent files

  1. Download dependent yum rpm package for offline installation.

     外网装个一样环境的虚机 用
     mkdir /root/1
     yum install cloud-init --downloadonly --downloaddir=/root/1
     yum install cloud-utils --downloadonly --downloaddir=/root/1
     然后把rpm包拷进内网,
     cd /root/1
     yum localinstall * -y
    

Turn off the firewall

  1. CentOS7 turn off the firewall

    # 关闭
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    
    # 打开
    systemctl start firewalld.service
    systemctl enable firewalld.service
    

Change the hostname

  1. CentOS7 change the hostname, effective immediately, is not lost after restart

    hostnamectl set-hostname 主机名称
    

disk partition

  1. Execute shell:

    磁盘分区
    fdisk $mount_point<<EOF
    n
    p
    1
    
    
    w
    EOF
    

Mounting swap partition

  1. Execute shell

    swapoff –a
    mkswap $mount_point
    swapon –a
    echo "$mount_point swap swap defaults 0 0" >> /etc/fstab
    
    

ssh refused landing

  1. Delete deny list:

    we /etc/hosts.deny

    Delete inside ip

Guess you like

Origin www.cnblogs.com/marvel888/p/12039882.html