first edited September 24, 2017 9:54:58
Summary
I. Network management
Two. SSH Service
Three. Shell
Four. Meta-characters
Homework
Summary today
Summary
Citation: Mr. Haifeng
- Network parameter Configuration
- SSH Service
- Shell
- Metacharacters
I. Network management
- temporarily Modify network configuration
- Modify IP address
- ifconfig NIC name IP address
- Modify DNS
- vim/etc/resolv.conf : Modify nameserver DNS address
- Configure Gateway
- route Add (DEL) default GW gateway address netmask Subnet Mask: temporary settings (delete) gateway address
- route-n View Settings
- Local resolution DNS
- /etc/hosts/: Local resolution Domain name, in the format: IP address hostname
- hostname: query hostname
- hostnamectl set-hostname host name: set hostname
- Configuration file Modify Network configuration
- cd/etc/sysconfig/network-scripts/find the native NIC configuration file (e.g. Ens33), Vim Ifcfg-ens33
- Change the Bootproto to static
- 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
- Systemctl Reload Network Reload NIC
Two. SSH Service
- 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
- Network copy
- SCP local file path destination IP: Destination path: remote Copy File
- SCP Destination IP: Destination file path Local path: remote download file
- SSH key
- Ssh-keygen: Making a remote access authorization key
- /root/.ssh/: Id_rsa is the key in the current home directory
- Ssh-copy-id-i Destination IP: Pass the key to the target host Id_rsa.pub
- SSH configuration file
- /ETC/SSH/SSHD_CONFIG:SSH configuration file
Three. Shell
- What is a shell?
- command interpreter, such as bash
- Shell Script
- 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
- 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
- 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
Homework
Summary today
Python Full Stack road Day7