Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of CentOS 7 on a virtual machine and remote control using Xshell (combination of operation theory! )

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Because CentOS 7 is one of the distributions of Linux, we need to know what a Linux system is before installing CentSO 7:

Linux is a free-to-use and free-spread Unix-like operating system. It is a multi-user, multi-task, multi-threaded and multi-CPU operating system based on POSIX and Unix. With the development of the Internet, Linux has received support from software enthusiasts, organizations and companies all over the world. In addition to maintaining a strong development momentum in the server operating system, it has made great progress in personal computers and embedded systems. Users can not only intuitively obtain the implementation mechanism of the operating system, but also modify and improve the operating system according to their own needs to maximize meet the needs of users. Linux is not only a stable system, but also an open source software. The core firewall components have high performance and simple configuration, which ensures the security of the system. In many enterprise networks, in order to pursue speed and security, Linux operating system is not only used as a server by network operators, Linux can be used not only as a server, but also as a network firewall is a bright spot of Linux. Compared with other operating systems, Linux has the characteristics of open source, no copyright and many users in the technical community. Open source enables users to cut freely, with high flexibility, powerful functions and low cost. In particular, the network protocol stack is embedded in the system, which can realize the function of the router after proper configuration. These characteristics make Linux an ideal development platform for developing routing switching devices.

First acquaintance with Linux system

The composition of Linux operating system

The Linux system is composed of:

Linux kernel: C language (process-oriented language) various peripheral programs: C++ language, such as desktop, network functions

Resolution of the version number:

XX.YY.ZZ

1.XX major version number

2.YY minor version number

3.ZZ revision number

4. Odd number represents the development board

5. Even number means stable version.

Stable version: from 2.4.6 to 2.4.7, where BUG is fixed to 2.4.8 to 2.4.

Development version: 2.5.7 from 2.4.7 copies by adding new features to 2.5. No, no, no. Finally to 2.5.77

Stable version: 2.6.1 to 2.6 from 2.5.77 copies. Where by repairing BUG to 2.6.18

Protocol introduction:

GPLZ (GUN General Public License)

1. General license Agreement for Free Software

two。 Allow users to copy, transmit, modify and publish at will

3. Software that is released again based on free software modification still has to comply with GPL

LGPL (Lesser General Public License)

1.LGPL is more relaxed than GPL, allowing all source code not to be made public.

two。 It provides more space for developing commercial software based on Linux platform.

Open source software: open source software (Open Source Sofeware)

Firefox web browser

OpenOffice Office Suite

Apache website server software

Mainstream Linux branch

The mainstream Linux distribution consists of:

1. Unix-like operating system based on Linux Kernel

2.Linux kernel and all kinds of free software

The name and version of the distribution shall be determined by the distributor:

1.Red Hat Red Hat Series

2.Debian Kelly series

3.Ubuntu Ubantu series

Hard drives, partitions and other devices are represented as files in Linux

/ dev / hda5

Dev: the directory where the hardware device files are located: hd:hd represents the IDE device, and sd represents the SCSI device a: the sequence number of the hard disk, with the letters a, b, c... . Represents 5: the sequence number of the partition, with the numbers 1, 2, 3... Express

Hard disk and partition structure:

Hard disk Partition Type:

MBR:4 partition types: primary partition, extended partition, logical partition

Note: at least one primary partition

1. Master + Lord

two。 Master + expansion

3. Master + Master + extension + extension

4. Master + expansion

Extended partitions cannot store data directly. Logical partitions are required to store data.

Logical partitioning needs to be based on extended partitions.

GPT: 128partition

Note: 1-4 is the primary partition, so the first logical partition starts at 5.

File system type:

The type of file system used by default in Linux

1.EXT4 fourth Generation extended File system version 6.0

2.XFS journaling file system version 7.0

3.SWAP Exchange File system

Other file system types supported by Linux

1.FAT16/32: a file size that does not exceed the 4GB size

2.NTFS

3.XFS,JFS

Next, let's start installing the image file of CentOS 7:

Preparation of the software:

1.VMware (download link can be found in my previous article)

The image file of 2.CentOS 7 is too large to be uploaded to the network disk, so I will post the download link on the official website for you to download. Here we choose the X86 64-bit image file:

Http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso

Xshall terminal simulation software, network disk link and extraction code are as follows:

Link: https://pan.baidu.com/s/1OrTfEPNRSWFcBMsX18W-cQ

Extraction code: dat8

After everything is ready to download, we can start to install it.

Let's go to the VMware virtual machine and click New Virtual Machine.

After opening the New Virtual Machine wizard, select Custom for Type configuration, and click next.

Version compatible with 14.x default, click next

To install the operating system, choose to install it later here, and click next

Select Linux for the client operating system and CentOS 7 64-bit for the version. Click next.

Set the name of the virtual machine to centos7-6, and choose the path of the installation location. Here we install it in the centos7-6 folder of disk D, and click next.

Processor configuration interface: if i5 processor chooses single core, if i7 quad-core eight-threaded processor chooses dual core, here we choose single core, click next

Virtual machine memory interface: at least 1GB. If the computer's memory is 4G, set it to 1G. If it is 8G, set it to 2G. Click next.

Network type interface: select NAT. Here we require that the established virtual machine can surf the Internet to ensure that centos is always connected to the network, because the installation package needs to be installed on the network. Click next.

Controller type is recommended by default. Click next.

Virtual disk type is recommended by default. Click next.

Select disk: create a new virtual disk and click next

Specify disk capacity: set it to 40GB, and click next

Disk file interface: choose to put it under the installation folder, here is centos7-6, click next

Ready to create a virtual machine interface: at this time, we can optimize the hardware, click on custom hardware, remove the sound card and printer, at the same time, we can load the centos7 image file, select CD/DVD, use the ISO image file, click Browse to find the root directory where you store the centos7 image file, and load it in. When you are done, click close, and then click finish, and the virtual machine has been built.

The process and results are shown in the following figure

Next, we click on the upper left corner to open the virtual machine, and in the interface that pops up, we press the up and down keys to select the first one, that is, to start the installation, and then hit enter:

After the installation is completed, the welcome screen will jump out of the prompt box. We will set the language to Chinese / simplified Chinese, and click continue.

Enter the installation information summary interface. At this point, we need to make the following settings:

1. Software selection: at this time, the default is to install only the kernel for the minimum installation. After we click enter, select the GNOME desktop, click finish, and refresh the load completion icon when finished.

two。 Installation location: automatic partition has been selected by default at this time. After we click to enter, select the partition I want to configure, and click finish to enter the manual partition interface. At this time, the default partition scheme is LVM logical partition. After we drop down, we can change to standard partition. Next, we can create a partition (also called add a new mount point here). Here we need to add four mount points as follows:

1. "/": root, assign 20GB

2. "swap": swap partition, virtual memory (physical memory is less than 1.5 to 2 times the size of virtual memory set by 4GB), because the physical memory we created earlier is 2G, so here we allocate 4GB

3. "boot": boot partition and assign 6GB

4. "home": home directory, assign 10GB

After all the additions have been completed, you can see all the mount points we added and their sizes. At this time, we click finish, jump out of the change summary screen to list the partitions we added, and then click accept changes and the partition settings are over. The specific process steps are as follows:

Other options do not need to be set. Just click the start installation in the lower right corner to enter the following interface:

We can first set the password of the root Super Admin in this interface: we enter the ROOT password setting, here we set it to 123123, and enter the confirmation again. At this time, the password is relatively simple. When we click on the completion in the upper left corner, the prompt "password does not meet the complexity requirements" will pop up below, but we can set the password successfully as long as we click finish again.

Click restart after the installation is completed, and after the restart is completed, you will jump out of the interface of the initial settings:

Click on the license agreement, check the consent license agreement below, and then click finish at the top left

After returning to the main interface, click finish configuration in the lower right corner, and the system will automatically restart to enter the welcome settings interface of centos7. Next, we will set the following items:

The language is set to Chinese, click forward keyboard default to Chinese, click forward privacy service to open by default, click forward time zone set to Shanghai, click forward online account no, click skip about you (add ordinary user name): here we add zhagnsan, click forward password setting: 123123, confirm input again, click forward click to start using CentOS, when you start again, you will log in with zhangsan account However, because ordinary users do not have enough privileges, we need to change the super administrator user root to log in after we enter the system.

After the restart is completed, we will get the following main interface of CentOS:

First of all, we click the close icon in the upper right corner, click zhangsan, select logout, and then log in to the ROOT Super Admin account. After logging out, we will return to the login screen, click not listed, enter the user name root, click next, enter the password 123123, and click login. At this time, we will enter the same setting process as above, and the operation will be the same as above. I will not repeat it here. After entering the system, we check the account and then log in to root users. The specific operation is shown in the following figure:

The next thing we need to do is to set it up so that it can surf the Internet. we click on the application in the upper left corner and find that the default browser that comes with the system is Firefox.

Although the network card mode is NAT mode at this time, clicking on the browser is still unable to connect to the Internet. The next thing we need to do is to connect it to the network. We must find the network card before we can set up access to the network. We go back to the desktop and right-click the blank space, select "Open Terminal", and then jump out of the command interface:

Next we enter the command: vim / etc/sysconfig/network-scripts/ifcfg-ens33 find the network card and hit enter

At this point, we enter the network card configuration table and see that there is an ONBOOT option at the bottom that controls whether the network card is turned on or off. If the status is NO, it is closed, and if it is yes, it is turned on. Here we need to change it to yes. We need to use the up and down keys to move the cursor to this line, but it is not possible to modify it directly here. We have to enter "I" first, and the following will prompt the status to insert.

We delete the no and enter yes, and after the modification is completed, we have to save the change, press Esc to exit, and then enter the ": wq" number to save and exit.

Since we are modifying the Nic configuration file, we need to restart the network service as follows:

Enter: servicre network restart in the command, and then hit enter

Then check the IP address: ifconfig. There are three network cards in total. We only need to look at the first ens33 local network card.

It contains the following information:

1.IP address: 192.168.195.136

two。 Subnet mask: 255.255.255.0

3.MAC address: 00:0c:29:c9:9d:88

At this point, we can use Firefox to test whether we can access the Internet, enter Baidu's URL www.baidu.com is accessible, for the Internet status.

We can also go back to the command interface and enter ping www.baidu.com to test the interconnection. By default, the long test does not stop. We can press Ctrl+C to stop, as shown below:

Next, to make a remote connection with Xshell, you need to install the Xshell terminal emulation software (for remote connection to the server) in your host in advance, as shown below:

Next, double-click to open and enter the software to connect and optimize:

After entering, you can pop out of the window, and click on the upper left corner to create a new session or connect directly. After the direct connection, the following window pops up:

The project we set up at this time is as follows:

1. Window name: centos7-6

two。 Protocol: SSH

3. The host is the IP address of the other party: here is 192.168.195.136

4. Port number: 22

Then there is the process of optimization:

1. Click on the terminal. At the coding point, we want to select UTF-8 that ends with identifying Chinese. If you use something else, you will see garbled code (default here is fine)

two。 Keyboard: select ASCII 127 on both sides of the key sequence

3. Appearance: color scheme selection ANSI Colors on White

4. Font: font name, Asian fonts are all changed to Consolas because this font can distinguish between Chinese and English punctuation marks, the font size is changed to 14

At this point, all optimizations are over.

Click on the link below after all the above changes have been completed. Enter the Xshell command interface, because the other party's IP address has been entered before, so the pop-up box prompts you to enter the key to log in to the host, at this time we choose to accept and save, at this time we need to enter the user name, we need to enter root (administrator authority is the largest), the following is to check to remember the user name, click to confirm, at this time prompted to enter the password, we enter the previously set password 123123 Also check the following box to remember the password, and then click OK, and the centos7 will be connected. The steps are as follows:

At this point, we enter the command ifconfig, and the interface displayed by tapping enter is the same as that obtained by typing ifconfig in centos7 (figure 1 below is the interface of centos7, figure 2 is the interface of Xshell):

Remote control is realized at this time! We can think about why we need to use remote operations: because there are often some scripts that we have edited on our computers, no matter where the server is, as long as it is turned on, we can directly use our host to run the Xshell connection to the corresponding server for remote management. And we can paste the edited script directly into the command interface of Xshell and load it directly, which is a way to improve efficiency!

The above is the installation of CentOS 7 on the virtual machine and the content of remote control using Xshell, thank you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report