Day07_ network management, SSH, Shell, and meta-characters

Source: Internet
Author: User
Tags aliases domain name server

I. Network management
  1. Temporarily Modify network configuration
    1. Modify IP Address
      • Ifconfig NIC name IP address
    2. Modify DNS
      • vim/etc/resolv.conf: Modify nameserver DNS Address
    3. Configure the Gateway
      • Route Add (DEL) default GW gateway address netmask Subnet Mask: temporary set (delete) gateway address
      • Route-n Viewing settings
    4. Resolving DNS Locally
      1. /etc/hosts/: Locally resolved domain name, in the format: IP address host name
      2. Hostname: Querying host names
      3. HOSTNAMECTL set-hostname hostname: Set host name
  2. Configuration file Modify Network configuration
    1. cd/etc/sysconfig/network-scripts/find the native NIC configuration file (e.g. Ens33), Vim Ifcfg-ens33
    2. Change the Bootproto to static
    3. The following parameters are added below
      • Ipaddr= Local IP
      • netmask= Subnet Mask
      • gateway= Gateway
      • Dns1=dns Address
        • Note that onboot must be yes, or the system will not load this parameter
    4. Systemctl Reload Network Reload NIC
Two. SSH Service
    1. View ports
      • The Netstat-an:netstat command is used to print the status information of network system in Linux, which can let you know the network situation of the whole Linux system;
        • -A or--all: Displays all sockets in the connection;
        • -N or--numeric: Use the IP address directly, not through the domain name server
    2. Network copy
      • SCP local file path destination IP: Destination path: remote Copy File
      • SCP Destination IP: Destination file path Local path: remote download file
    3. SSH key
      1. Ssh-keygen: Making a remote access authorization key
      2. /root/.ssh/: Id_rsa is the key in the current home directory
      3. Ssh-copy-id-i Destination IP: Pass the key to the target host Id_rsa.pub
    4. SSH configuration file
      • /ETC/SSH/SSHD_CONFIG:SSH configuration file
Three. Shell
    1. What is a shell?
      • command interpreter, such as bash
      • Shell Script
    2. Command priority
      • ==> Alias: Alias
      • ==> Compound Commands:if while for
      • ==> function: Functions
      • ==> build_in: Built-in
      • ==> Hash: View Hash table
        • -R Empty Hash table
        • Set: View defined variables and functions
        • unset function Name: Delete the definition of the function
        • Alias: Defining aliases
        • Unalias: Deleting aliases
      • ==> $PATH
      • ==> Error:command not found
    3. Read-p ' Print content ' variable (name): Print prompt to print content, wait for input, and store input in Relpay, i.e. name = input
      • read–p "string" var1 var2...varn Note a space between "string" and var1
      • Echo & Variables
Four. Meta-characters
    1. Special characters in Bash, and special characters that can be knocked out on the keyboard, have a special meaning, emphasizing one thing: metacharacters are interpreted by the shell
      • ': ': The colon is always true

Day07_ network management, SSH, Shell, and meta-characters

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.