1th Chapterthe composition of the computer
CPU Hard Disk Memory power
2nd ChapterMemory
Memory is a temporary storage file, data loss after power outage
Program: Write data to disk
Process: Running program read in memory
Daemon: A program that has been running
3rd Chapterimprove the user experience
Large concurrency data is first written to the memory disk to be read on disk
Small users first put data into disk to read data from memory
4th Chapter Bufferand theCatchthe Difference
Buffer buffers write data into memory
The catch cache reads data from memory
Storage for permanent storage of data on disk
5th Chapterthe development process of computer
Egg-man-man-man
Unix born at Bell Labs
Tan Ningbong Studies the teaching of Minix teaching
Founder of the Stallman Free Software Foundation GNU Project
Tawas the father of Linux
The GNU kernel hasn't been developed yet. The core is bash gawk
GPL is a general public license that everyone is free to use freely and will be modified and distributed.
Chapter 6th SSHServer Connectivity Failure
First of all, see if the road ping 10.0.0.200 if you pass
See if anyone is robbing the firewall. Iptables (chkconfig iptables off)
Chkconfig |grep iptables (view)
See if anyone buys a ticket.
Does the SSH service turn on telnet10.0.0.200 22
7th Chaptermethods for server partitioning
Method One There's no important data.
/boot storage System is the boot information 200M
Swap partition to prevent memory when memory is greater than 8G give 8G if memory is less than 8G 1.5 times times of memory 768M
/How much is left
Method Two when there is important information
/boot boot System Information 200M
Swap partition prevents memory from running out when memory is greater than 8G to 8 g, memory is 1.5 times times 768M when memory is less than 8G
/root Partition 20-200g
/data Store important Information how much is left
Method Three I don't know if the data is heavy.
/boot boot System Information M
Swap partition prevents memory from running out when memory is greater than 8G to 8G if it is less than 8G time 1.5 times times of memory
/Root 20-200g
The remaining memory, left to the person to use
8th ChapterViewSshdwhether the service exists
[Email protected] oldboy]# ps-ef |grep sshd
Root 1533 1 0 13:34? 00:00:00/usr/sbin/sshd
Root 1627 1533 0 13:35? 00:00:01 sshd: [Email protected]/0
Root 1726 1631 0 14:13 pts/0 00:00:00 grep sshd
This will run the
ps-ef |grep sshd to see if the SSH service is running
Rpm-qa | grep SSH can see the system in the SSH installation package
RPM-QL openssh-3.5p1-6 View the installation package installation information (such as installation path, configuration file, etc.)
If it is not running, the
[Email protected] oldboy]#/etc/rc.d/init.d/sshdstart
[[Email protected] oldboy]# service sshd start
[Email protected] oldboy]# NETSTART-NTLP
If you're still not connected, try shutting down the firewall.
Service Iptables Stop
9th ChapterOptimizedSELinux
Temporarily closed
[Email protected] ~]# Setenforce
Usage:setenforce [Enforcing | Permissive | 1 | 0]
[Email protected] ~]# Setenforce 0
[Email protected] ~]# Getenforce
Permissive
Permanently closed
[Email protected] ~]# Vim/etc/selinux/config
Selinux=enforcing modified to Disabled
[[email protected] ~]# grep "=disabled"/etc/selinux/config
Selinux=disabled
Restart takes effect
10th Chaptershutting down the firewall
Temporarily closed
[[email protected] ~]#/etc/init.d/iptables start
iptables:applying firewall rules: [OK]
[Email protected] ~]#/etc/init.d/iptables status
Table:filter
Chain INPUT (Policy ACCEPT)
Num Target prot opt source destination
1 ACCEPT All – 0.0.0.0/0 0.0.0.0/0 State related,established
2 ACCEPT ICMP--0.0.0.0/0 0.0.0.0/0
3 ACCEPT All--0.0.0.0/0 0.0.0.0/0
4 ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 State NEW tcpdpt:22
5 REJECT All--0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (Policy ACCEPT)
Num Target prot opt source destination
1 REJECT All--0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (Policy ACCEPT)
Num Target prot opt source destination
[[email protected] ~]#/etc/init.d/iptables stop
Iptables:setting chains to Policy Accept:filter [OK]
iptables:flushing firewall rules: [OK]
iptables:unloading modules: [OK]
[Email protected] ~]#/etc/init.d/iptables status
Iptables:firewall is not running.
Permanently closed
[Email protected] ~]# chkconfig iptables off
[Email protected] ~]# chkconfig |grep iptables
Iptables 0:off 1:off 2:off 3:off 4:off5:off 6:off
run on top of 3
[[email protected] ~]# chkconfig--level 3 iptables on
[Email protected] ~]# chkconfig |grep iptables
Iptables 0:off 1:off 2:off 3:on 4:off5:off 6:off
11th Chapter Linuxthe RunLevel in
0 shutdown (not normally set)
1 Single-User mode
2 Multi-user mode without NFS (network configuration file)
3 full multi-user mode, Command mode (common in work)
4 Not used
5 Image Interface Mode
6 Restart (not normally set)
12th Chapter Linuxgarbled text
A typical Linux system uses a character set that differs from the Xshell software's character set. There will be garbled
Fix garbled
[Email protected] ~]# Export.utf8
[Email protected] ~]# echo $LANG
En_us.utf8
[Email protected] ~]# cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
Lang= "en_US. UTF-8 "
13th Chapterrun-level modifications
Temporary:
[Email protected] ~]# RunLevel
N 3
[[Email protected] ~]# Init 5
[Email protected] ~]# RunLevel
3 5
[[Email protected] ~]# Init 3
[Email protected] ~]# RunLevel
5 3
It's resumed after a reboot.
2. Permanent Modification
[[email protected] ~]# grep "ID:"/etc/inittab
Id:3:initdefault:
14th ChapterSetting Aliases
view aliases with alias
Temporarily modify aliases
[[email protected] ~]# alias net= ' Cat/etc/sysconfig/network-scripts/ifcfg-eth0 '
[[email protected] ~]# net
Device=eth0
Hwaddr=00:0c:29:0e:80:e8
Type=ethernet
Uuid=6f54df19-76a0-4fd6-9e9a-462246fdcbea
Onboot=yes
Nm_controlled=yes
Bootproto=none
ipaddr=10.0.0.200
netmask=255.255.255.0
gateway=10.0.0.2
Userctl=no
Peerdns=yes
Ipv6init=no
dns1=223.5.5.5
dns2=223.6.6.6 not effective
Permanently modify aliases
[Email protected] ~]# cat/etc/profile
[[email protected] ~]# alias net= ' Cat/etc/sysconfig/network-scripts/ifcfg-eth0 '
[Email protected] ~]# source/etc/profile
[[email protected] ~]# alias
Alias cp= ' Cp-i '
Alias l.= ' ls-d. *--color=auto '
Alias ll= ' Ls-l--color=auto '
Alias ls= ' ls--color=auto '
Alias mv= ' Mv-i '
Alias net= ' Cat/etc/sysconfig/network-scripts/ifcfg-eth0 '
Alias rm= ' echo do not user RM command '
Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde ' effective
15th Chapter Linuxconfiguration file for the operating level of the system
/etc/inittable
0 Turn off the machine
1 Single-User mode
2 Multi-user mode
3 full multi-user mode command mode
4 Not used
5 Graphical interface mode
6 restart
16th Chapter LinuxBoot- up process
BIOS self-Test
MBR boot
Grub Menu
Load kernel
Run the INIT process first process
Select Run Level Etc/inittab
Initialize the system settings host name and IP address etc/rc.d/rc.sysinit
Self-starting software commands or scripts based on RunLevel
Mingetty Display Login Interface
17th ChapterNetworkPingcause of the failure to pass
Network does not pass
If Ping baidu.com does not pass
Ping the IP address of the outside network if the
That's the DNS configuration problem.
Cat >>/etc/sysconfig/network-scripts/ifcfg-eth0<<eof
dns1=223.5.5.5
dns2=223.6.6.6
Eof
Restart effective or/etc/init.d/network restart
18th Chapter Inodeand theBlock
1. How did it come about?
To create a file system formatted
2. What do you mean?
The inode is where the index node holds the file attributes and block
The block holds the actual data (the file name is stored in the block of the previous level directory)
3. Features
1) Create a non-empty file to occupy an inode and at least one block
2) If the inode of two files is the same, the two files are hard to connect to each other, the condition that the two files must be in the same partition
3) Block 4k, if the storage of small files 1k, the remaining space is wasted
4) inode 256 bytes
19th Chapterthe difference between hard links and soft links
There are two types of links in Linux, one is a soft link and the other is a hard link
1. How to create
LN creates a hard link with no arguments by default, Ln-s creates a soft link
2. Meaning
A hard-link file is the same as the inode number of the source file (in the same file system or partition), and the soft link is equivalent to a shortcut inside windows
3. Features:
You cannot create a hard link to a directory, but a soft link can,
Soft links can cross file systems, but hard links can not
4. Why not?
Delete soft link files, no impact on source files and hard links
Delete hard link files, no effect on source files and soft link files
Delete source files, no impact on hard-link files, but have impact on soft link files, will cause soft link failure
Also delete the soft and hard connection file, the entire file will be really deleted
Linux Key Knowledge Summary