Mago Study Notes (i)

Source: Internet
Author: User
Tags dns2 symlink ssh port

System version:

ISO:centos-7-x86_64-everything-1511

(The language of the installation is the Chinese version, the support is also good, see the help information is very convenient)

[[email protected] ~]$ cat/etc/redhat-release #系统最小化安装, hereinafter referred to as C7.2centos Linux release 7.2.1511 (Core)


To view the SSH port:

[[email protected] ~]$ ss -tnl              #查看SSH端口, you can see the default 22state      recv-q send-q local  Address:port               peer  address:port              listen      0      128           *:22                        *:*                    LISTEN     0       100    127.0.0.1:25                        *:*                    LISTEN     0       128         :::22                        :::*                    LISTEN     0      100         ::1:25                       :::*


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/85/35/wKioL1ecqe3xW7NqAAL4capI9pw100.jpg-wh_500x0-wm_3 -wmp_4-s_3865009337.jpg "title=" SSH remote connection. jpg "alt=" wkiol1ecqe3xw7nqaal4capi9pw100.jpg-wh_50 "/>


Add DNS: (IP address set slightly)

Note: The official recommendation is to set up DNS under/etc/sysconfig/network

[[email protected] ~]# vi/etc/sysconfig/network #根据当地运营商, add fill DNS1, dns2# Created by anacondadns1=114.114.114.114 dns2=202.106.0.20

View IP Address:

Description: Because C7.2 is minimized, you cannot use ifconfig commands that are commonly used on C5 or C6, and you can use the IP Addr List command to see if you want to use Ifocnfig, which you need to install Net-tools this toolkit.

[[email protected] ~]$ ifconfig-bash:ifconfig: Command not found [[email protected] ~]$ IP Addr List | grep ' inet 10.3 ' inet 10.3.20.71/24 BRD 10.3.20.255 Scope Global eno16777736

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/85/35/wKioL1ecrBjBnc0bAAMqC-XJ32I301.jpg-wh_500x0-wm_3 -wmp_4-s_2655656240.jpg "title=" ip.jpg "alt=" Wkiol1ecrbjbnc0baamqc-xj32i301.jpg-wh_50 "/>

Install the net-tools kit to use the Ifconfig command

[Email protected] ~]# yum-y install net-tools #切换到root下, installation Kit .... Running transaction Installing: net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Authentication: net-tools-2.0- 0.17.20131004git.el7.x86_64 1/1 installed: net-tools.x86_64 0:2.0-0.17.20131004git.el7

Use ifconfig to view IP

[Email protected] ~]$ Ifconfig | grep ' inet 10.3 '

inet 10.3.20.71 netmask 255.255.255.0 broadcast 10.3.20.255

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/85/35/wKioL1ecrZix2DEEAAMEkbHqIrY254.jpg-wh_500x0-wm_3 -wmp_4-s_2628504443.jpg "title=" ip1.jpg "alt=" Wkiol1ecrzix2deeaamekbhqiry254.jpg-wh_50 "/>


Firewall:

To view the rules:

[[email protected] ~]# iptables -l -n                #使用此命令查看规则Chain  INPUT  (policy accept) target      prot opt source                destination         ACCEPT      all  --  0.0.0.0/0             0.0.0.0/0            ctstate  RELATED,ESTABLISHEDACCEPT     all  --  0.0.0.0/0             0.0.0.0/0            INPUT_direct  all  --  0.0.0.0/0        &nBsp;    0.0.0.0/0           input_ zones_source  all  --  0.0.0.0/0             0.0.0.0/0           input_zones   all  --  0.0.0.0/0             0.0.0.0/0          &NBSP, ........... Slightly

Purge rule: (only valid for current)---generally not.

[Email protected] ~]# iptables-f

Turn off: (only valid for current)

[[email protected] ~]# systemctl stop firewalld.service[[email protected] ~ ]# iptables -l -n                   Chain INPUT  (policy accept) target      prot opt source                destination         Chain FORWARD  (policy  ACCEPT) target     prot opt source                destination          Chain OUTPUT  (policy accept) Target     prot opt source                destination

To turn off permanently: (this one is used)

[Email protected] ~]# systemctl disable firewalld.serviceremoved symlink/etc/systemd/system/ Dbus-org.fedoraproject.firewalld1.service.removed symlink/etc/systemd/system/basic.target.wants/ Firewalld.service. [Email protected] ~]# systemctl disable Firewalld.service[[email protected] ~]#

Centos 6 Switch off the firewall:

~] #service iptables Stop ~] #chkconfig iptables off


Terminal Equipment: Terminal

Description: Multi-tasking, multi-user

Physical terminal, console: Console

Virtual Terminal: 6 TTY

CTRL+ALT+F[1-6]

Graphics Terminal:

CentOS 6:

CentOS 7:

Which virtual terminal is on, which virtual terminal

Serial Terminal: TTYs

Pseudo Terminal: Pty


One of the philosophical ideas of Linux: All documents:

One of the performance: hardware devices are also represented by files:

Physical Terminal:/dev/console

Virtual Terminal:/dev/tty#[1,6]

Serial Terminal:/dev/ttys#

Pseudo Terminal:/dev/pts/#

Example:

View on SECURECRT, clone multiple sessions, TTY view displayed results, show pseudo terminal/dev/pts/0, 1, 2

[[email protected] ~]$ TTY

/dev/pts/0

[[email protected] ~]# TTY

/dev/pts/1

[R[email protected] ~]# TTY

/dev/pts/2

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/85/35/wKiom1ecsvHhkjxMAAJsDGa361k195.jpg-wh_500x0-wm_3 -wmp_4-s_1917790988.jpg "title=" tty.jpg "alt=" Wkiom1ecsvhhkjxmaajsdga361k195.jpg-wh_50 "/>

Press CTRL+ALT+F2 on VMware to display as a serial terminal tty2

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/85/35/wKioL1ecs_XxvEieAAJwk1CSlqM080.jpg-wh_500x0-wm_3 -wmp_4-s_493804392.jpg "title=" qq20160730220417.jpg "alt=" Wkiol1ecs_xxveieaajwk1cslqm080.jpg-wh_50 "/>


To view the interface program:

[Email protected] ~]# echo $SHELL/bin/bash


Start GUI: (This command has no experiment)

Run a command on a virtual Terminal interface: StartX &


Access to Linux command help:

Internal command help:

# Help COMMAND

Use the type CD to know that it is an inline command, if you need help, you can use the CD to get a general format

[[email protected] ~]# type cd                            #得知cd是内嵌命令cd   is  shell  embedded [[email protected] ~]# help cd                             #使用help  CD Get help cd: cd [-l|[ -p [-e]]] [dir]    change the shell working directory.         Change the current directory to DIR.   The default DIR is the value of the    HOME  Shell variable.        the variable cdpath defines  the search path for the directory Containing    dir.  alternative directory names in cdpath  are separated by a colon  (:).     a null directory  name is the same as the current directory.  if dir  begins    with a slash  (/),  then cdpath is not  USED.   &NBSP, ... Slightly

Help is also an inline command to see how it helps

[[email protected] ~]# type helphelp  is  shell  embedded [[email protected]  ~]# help help                           #中括号是可省略的help:  help [-dms]  [mode        displays information about the inline command.          displays a brief message of the inline command. If  PATTERN  mode is specified,     give detailed help for all commands that match  PATTERN  mode, otherwise hit       Print a Help topic list          options:      -d          output A short description of each topic       -m          show usage in pseudo  man  manual format       -s          Show only one usage for each theme of the matching  PATTERN  mode           Introduction          parameter:      pattern    pattern  mode specifies a Help topic          exit status:     return success unless  PATTERN  mode is not found or an invalid option is used.


This article is from the blog "Write to Yourself", so be sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1832187

Mago Study Notes (i)

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.