March 9, 2015 20:09:02
I. Brief description of Linux
Second, the installation of Linux
Third, the Linux network card configuration
Four, using Xshell or putty Telnet, and key login
A brief description of Linux:
Linux is a branch of UNIX and 1991 was initiated by Linus Torvalds (Torvalds) . The core of Linux is kernel.
Linux distributions: Well-known centos,redhat, beautiful Ubuntu, SuSE for development, and more.
What is the use of Linux: Most servers now use Linux systems, and the Android system we know is packaged with the Linux kernel (kernel), the main purpose of learning Linux is to learn how to operate Linux and maintain servers.
GUN:GNU is the "GNU's not Unix" recursive abbreviation ,theGNU program, also known as the Slave program, is by Richard Stallman was publicly launched on September 27, 1983. Its goal is to create a set of completely free operating systems.
GPL : The GNU General public License, the GNU Universal License, is the Universal Copyright authentication Agreement of Free software (software), which is developed and published by the Free Software Foundation (FSF). So gun is a plan, and the GPL is a certification agreement that supports the program.
Installation of Linux: (VMware version 11 and CentOS 6.5 32-bit system)
The installation system is relatively simple
1. "Create a new virtual machine" on the Virtual Machine home page, next
2, select "Typical", next
3, installation Source This step, need to prompt, generally choose "Install the system later", if you choose "Install image File", will appear the root password of the user name to enter Linux, then the system will be installed automatically.
4, choose Linux, Version is CentOS, note is not 64-bit version, next
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5B/35/wKiom1UBd6WR0NUiAAEoeqmCeYA830.jpg "title=" Clipboard.png "alt=" Wkiom1ubd6wr0nuiaaeoeqmceya830.jpg "/>
5, Next is the virtual machine name and the location of the virtual machine
6, next for the virtual machine to allocate 20G capacity, this is generally dynamic, and will not take a look at the disk to occupy 20G
7, this step is a bit of a key
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/2F/wKioL1UBeOuyUs6tAAFgn-oWU5g790.jpg "title=" Clipboard.png "alt=" Wkiol1ubeouyus6taafgn-owu5g790.jpg "/>
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Custom hardware, because we installed a minimal CentOS system, the memory is generally 1G enough, a processor can be, add the CentOS ISO image file, for the system, the network adapter using the bridge mode, the other is left to leave the tube, and finally "done", to start the virtual machine.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/2F/wKioL1UBeSDRzVcZAAFk1ly92BA681.jpg "title=" Clipboard.png "alt=" Wkiol1ubesdrzvczaafk1ly92ba681.jpg "/>
8. Enter the Start screen and select "First item"
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/35/wKiom1UBeEGgpeXcAAG9X5i6V2s672.jpg "title=" Clipboard.png "alt=" Wkiom1ubeeggpexcaag9x5i6v2s672.jpg "/>
These separate points indicate:
1. Install or upgrade an existing system (graphical interface installation)
2. Install the system using the basic graphics device (text-mode installation)
3. Rescue installed System (Rescue mode)
4. Boot from hard drive
5. Memory Test
9, this step is to detect your system image file damage, if your image file is downloaded from the official website, select "Skip", do not waste time to detect
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5B/2F/wKioL1UBeX3jSke8AADDuf1r7Ac315.jpg "title=" Clipboard.png "alt=" Wkiol1ubex3jske8aadduf1r7ac315.jpg "/>
10, then "Next", see the Language Options, we choose Chinese Simplified, if you are good enough English, then "English" bar, then "Next", the keyboard Select "American", the next step, see the warning, ask you whether the disk has data, will format the disk, No or the data is not important, that is, select "Yes, ignore all data", otherwise, the next step, set the "hostname", depending on the individual situation. Keep the next step, leave the default, and then set the root password.
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/2F/wKioL1UBeejBFGW2AAC1-spFpa4757.jpg "title=" Clipboard.png "alt=" wkiol1ubeejbfgw2aac1-spfpa4757.jpg "/>650" this.width=650; "src=" Http://s3.51cto.com/wyfs02 /m00/5b/35/wkiom1ubemjsjp9jaagbxontzjw828.jpg "title=" Clipboard1.png "style=" Float:none; "alt=" Wkiom1ubemjsjp9jaagbxontzjw828.jpg "/>
11. Installation Type
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/2F/wKioL1UBeeixvK4kAAGRwQno8IQ960.jpg "title=" Clipboard2.png "alt=" Wkiol1ubeeixvk4kaagrwqno8iq960.jpg "/>
What each option means, this is explained above, we generally use "custom", if the use of "all space", then the system will be 20G of hard disk capacity is automatically partitioned by LVM volume group.
13, to the system partition, important. Swap: Similar to Windows virtual memory, the capacity of the hard disk as a small block of virtual memory, the general swap set to 1-2 times the memory, but it should be noted that if the memory is greater than 8G, there is no need to set twice times, if it is a solid-state drive such expensive items, it is a bit wasteful, The general situation also does not use so large virtual memory, 200M to/boot partition, the rest of the root directory bar.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/35/wKiom1UBeVixweHeAACNRaI1YJ8451.jpg "title=" Clipboard2.png "alt=" Wkiom1ubevixweheaacnrai1yj8451.jpg "/>
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
14, Next, the installation of minimal system, as in the installation of the server system, not recommended to install desktop, because the desktop is also as a software run, which will waste valuable memory and disk resources, the next step is to wait for the installation process.
Third, the Linux network card configuration
Ifconfig: Viewing network card information
ifconfig-a: View all network cards, including non-bootable NICs
You can use the dhclient command to get an IP address automatically, or you can manually configure/etc/sysconfig/network-scripts/ifcfg-eth0
Details of this configuration file are as follows:
...
onboot=yes // Whether to start with the boot, yes, the default is No
nm_controlled=yes Whether the configuration is allowed to be modified by default Yes
bootproto=dhcp // DHCP can use Dhclient to obtain the IP automatically, will automatically obtain the DNS address, if changed to static, indicates that the IP is manually configured
---------------------------------Split Line------------------------------------
To configure IP manually:
IPADDR=192.168.1.110//Subnet IP
netmask=255.255.255.0//Subnet mask
gateway=192.168.1.1//Gateway
dns1=202.98.96.68//After you set up DNS in this file, after you restart the eth0 NIC,/etc/resolv.conf This configuration file will get the DNS address.
!$: Last parameter of previous command
Restart Network Service:
/etc/init.d/network restart
Service network Restart These two commands are available
Four, using Xshell or putty Telnet, and key login (I use the Xshell, so with Xshell take notes)
1, generate the key in the Xshell, in order to secure and then you should give a password to the key. 650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" border:1px solid rgb (221,221,221); background-position:50% 50%; "alt=" Spacer.gif "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/35/wKiom1UBekuy8g3EAAFUij-NodY880.jpg "title=" Clipboard.png "alt=" Wkiom1ubekuy8g3eaafuij-nody880.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5B/2F/wKioL1UBe2uCitF4AACWI4MSilE581.jpg "title=" Clipboard1.png "alt=" Wkiol1ube2ucitf4aacwi4msile581.jpg "/>
2. Copy the public key
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5B/35/wKiom1UBetOCKJRtAAEdVv_knHE890.jpg "title=" Clipboard.png "alt=" Wkiom1ubetockjrtaaedvv_knhe890.jpg "/>
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
3, login system, in the root directory to complete the following command
# mkdir/root/.ssh && chmod 700/root/.ssh
# chmod 600/root/.ssh/authorized_keys
Then VI. Ssh/authorized_keys Paste the copied public key into this file.
4. Finally close SELinux, similar to Windows Firewall
①, Setenforce 0 order, temporary effect
②, modify the configuration file to take effect permanently: vi/etc/selinux/config
Only need to change the selinux=enforcing to selinux=disabled, need to restart the system.
③, Getenforce: To view the status of SELinux, the display enforcing indicates that it is not closed or vice versa.
5, restart after re-login Xshell, select public key input before setting the private key password, you can
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5B/35/wKiom1UBe3qBYFtIAAFqly7qdfo356.jpg "title=" Clipboard.png "alt=" Wkiom1ube3qbyftiaafqly7qdfo356.jpg "/>
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Here is an excerpt from the Classmate Note Putty Key login:
Use Puttygen to generate a key pair. Save the private key.
Mkdir/root/.ssh
ls/root/
Ls/root/-A
Vi/root/.ssh/authorized_keys (Add public key to this file)
Modify Permissions
Modify file permissions: chmod 600/root/.ssh/authorized_keys
Modify directory Permissions: chmod 700/root/.ssh
To remove a firewall rule:
Iptables-f
Service Iptables Save
Turn SELinux off and temporarily shut down with Setentforce 0
Permanently closed as: Vi/etc/linux/config selinux=disabled.
Finally, upload the private key to putty
Personal understanding of the bridge mode, Nat mode, and host mode of the virtual machine:
In the VMware 11 release, a total of 20 virtual network cards, by default, only started three network cards, VMnet0 (bridge mode), VMnet1 ( host mode ) and VMnet8 (NAT mode).
Bridging mode: If your real network card is connected to the Ethernet, then the bridge mode can give the virtual machine installed system assigned IP and Real machine is the same network segment, they are equivalent to two machines under the same router ( host and virtual machine in a peer position ), can access each other to the network of machines, that is, can ping each other.
In Linux, if the host is connected to the router, the general router has an open DCHP service, so use the dhclient command to obtain IP automatically, if manually assigned, you need to assign to the same network segment with the real network card IP and subnet mask.
Nat mode: Also known as the network address translation, the virtual machine system through the network address translation function, simply say the real machine as a router, from the real machine is located in the network to access the Internet. The IP assigned by the virtual system is a subnet IP under the VMNET8 network card (192.168.200.0), through experiments in this mode virtual system can only communicate with the real machine, and other network machines can not ping each other, the condition is the real function access to the Internet, then the virtual system will be able to surf the Internet.
Host-only (host) mode: they are equivalent to a real machine and virtual machine through a network cable directly, virtual system through VMNET1 this virtual network card (192.168.75.0) under a subnet, virtual system and real-world system can communicate with each other.
Summary: If you need to rebuild the virtual system into a local area network, then you should choose NAT mode, and then through the VMNET8 network card DHCP assigned IP is in the same network segment, you can also manually assign a static IP, However, it is important to note that the subnet under this virtual network card must be VMnet8, thus forming a virtual local area network. If you want to form a local area network with the real machine, then bridging is your first choice.
How does CentOS make the NDS server address permanent?
A: http://www.aminglinux.com/bbs/thread-7474-1-1.html this classmate is talking about adding the/etc/sysconfig/network-scripts/ifcfg-eth0 configuration file Peerdns=no.
So what is the meaning of the Peerdns parameter, followed by yes/no, the default is yes, indicating that if it is a DHCP (dhclient command) then it will automatically modify/etc/resolv.conf this file, the obtained DNS server is automatically added. If no, do not modify the configuration file, through the experiment, whether it is the dhclient command, or add dns1=202.98.96.68 inside the/etc/sysconfig/network-scripts/ifcfg-eth0, and then restart/etc /init.d/network Restart, eventually found that/etc/resolv.conf will not change, so as long as you manually add a DNS server in/etc/resolv.conf then you can achieve the effect of permanent DNS address.
This article is from "Xiao Xu" blog, please be sure to keep this source http://loopholes.blog.51cto.com/9445813/1619828
Learn Linux Journeys--day one--