Python full stack Linux base (partial) network SSH renaming DNS parsing meta-characters

Source: Internet
Author: User

Nginx---> Web

Ifconfig Viewing network configuration information

ID Add Show view current NIC information (under Minimum installation)

MTU refers to the maximum unit of units transmitted by a network card: bytes

NIC Configuration

Temporary configuration

Ifconfig NIC name IP address/subnet

Dns:vim/etc/resolv.conf

Gateway:

(add) route add default GW gateway Netmask 255.255.255.0

(delete) Route del default GW Gateway netmask 255.255.255.0

View configuration: Route-n

Restart network card: Systemctl Restart Network

Permanent configuration

cd/etc/sysconfig/network-scripts/

Vim ifcfg-en033 (NIC)

bootproto= "Static"

Ipaddr=

netmask=

gateway=

dns1=

Dns2=

Save exit

Restart the NIC.

View and change DNS configuration: cat/etc/resolv.conf

DNS Configuration Local resolution address setting host name and resolving address

View native host Name: hostname

Modify host Name: Hostnamectl set-hostname new name

Vim is configured in/etc/hosts/

The original file does not move, add the configuration information below

Comment out the local DNS address (or you can not move it)

Add the IP address user name that you want to resolve in the file

Save exit

SSH protocol

SSH IP Address Login other host

Transfer native files to other machines scp/etc/hosts 192.168.16.151:/tmp

Download files from other machines to this machine

Command: SCP 192.168.16.151:/root/1111.txt. (Current path)

Each connection requires a password, in order not to knock the password every time, to establish a suo relationship

The lock leaves itself:

Key sent to other people: Storage path:/root/.ssh/*

Code: Ssh-keygen (Create key)

Give the key to someone: Ssh-copy-id-i (receive server address)

You don't need a password to sign in again.

Change the login port

Vim/etc/ssh/sshd_config opening an SSH configuration file

changing ports port 8888

Save exit

Restart the SSH service

Another host with SSH login test: SSH IP address-p 8888

Shell

Source Execution Command

Metacharacters is explained by the shell.

* represents all

~ Representative Home Directory

"(anti-quote) $ ()

! Reverse, the history command can be executed

"" represents finding the enclosed content within parentheses, taking only one value

Determine if the previous command succeeded: Echo $? (0 is correct and the others are errors)

$ Value% Fetch

|| After the first command succeeds, the rear is not executed; If the front execution is unsuccessful, then the execution

\ transpose symbol, echo "\ $x"---> $x

echo $? Forever is true!

? Match only one arbitrary character

Python full stack Linux base (partial) network SSH renaming DNS parsing 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.