Getting Started 11 linux lab manual and related public knowledge

  1. NIC to add multiple addresses and delete
    ip addr the Add 192.168.25.166/24 dev eth0
    ip AA 192.168.25.166/24 dev eth0 (abbreviated)
    ip addr del 192.168.25.166/24 dev eth0
    ip addr {the Add | Change | ifaddr the replace} dev STRING
  2. centos7 Firewall:
    systemctl Status iptables
    if the result of the step is not found, the installation: yum install iptables-services
    default to not start after installation, systemctl Start iptables.service
    iptables -L -n to list all the rules
    iptables -F # Clear (filter table) all the rules
    INPUT: filtering incoming packets host; -A: appended to the last rule;
    after setting restart rule: systemctl restart iptables
  3. Turn off the firewall:
    systemctl STOP firewalld The ban
    systemctl disable firewalld.service # prohibit firewall boot, after centos7 version;
    chkconfig iptables OFF centos6 previous versions
  4. ⼀ create a simple shell script, based on public key to complete the login password for
    ssh login authentication service based on key
    ssh-keygen -p reset the private key password
    ssh-keygen -P Provides the (old ) passphrase, -P '' that is generated when venting
    cat sshkeyau.sh #!/bin/bash rpm -q expect &> /dev/null || yum -y install expect ssh-keygen -P "" -f "/root/.ssh/id_rsa" userpwd="123456" while read ipaddr;do expect <<EOF set timeout 10 spawn ssh-copy-id $ipaddr expect { "yes/no" {send "yes\n"; exp_continue} "password" {send "$userpwd\n"} } expect eof EOF done < ip.txt cat ip.txt 192.168.11.118 192.168.11.235

  5. View chrony valid configuration files
    grep -Ev "^ (#. Star |) $" /etc/chrony.conf; principles: (C | c) at Cat or cat, so ^ (. # Star) or $ ^
    grep -Ev "^ (# * Star |. $)" /etc/chrony.conf, this also
    grep -Ev "^ # | ^ $ " /etc/chrony.conf
  6. rsync, pssh, sftp tool

Guess you like

Origin www.cnblogs.com/linux521/p/11111127.html