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

How to deploy the Linux system environment

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to deploy the Linux system environment". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Take Aliyun as an example, the first place by default is CentOS, which provides multiple images from 7.6 to older versions.

1. Download

In the following article, we will base our environment on the stable version of CentOS 7. Centos is very popular, so there are many mirrors. Domestically, we download from Shanghai Jiaotong University, the speed should be faster.

Http://ftp.sjtu.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1908.iso

If Jiaotong University doesn't maintain it one day. You can find it here:

Http://centos.mirror.ndchost.com/7/isos/x86_64/CentOS-7-x86_64-Minimal-1908.iso

In order to let you learn more knowledge, we use the minimized system ISO. The minimized iso is less than the 1GB, while the dvd with a lot of software is the size of a 4.3GB. We'll use this diet version.

2. Install Linux

The easiest way to learn and experience Linux quickly is to install it using a virtual machine. At present, one of the most popular virtual machines is VMware and the other is VirtualBox. There is also a Parallels Desktop on MacOS.

Among them, VirtualBox is free and cross-platform, which can meet our needs. Next, you will be guided through the installation step by step.

(1) Click New to start the installation journey.

(2) fill in the name and version. Then click continue.

(3) Select memory according to your machine configuration

My machine has 8GB memory, so it is allocated to the virtual machine 2GB, which is enough.

(4) create a virtual disk

After clicking continue, a dialog box will pop up. We don't have to worry about it, just keep going until the dialog box disappears. It's very rough.

(5) next, click Settings.

(6) switch to the Storage option and select the iso we downloaded

(7) Click start to start the installation.

Use the arrow keys to switch so that the highlight is focused on Install CentOS 7. Click OK to begin the installation.

(8) Pop up an installation interface

There are a lot of steps to follow, so if we don't have a special introduction, then continue will be ok.

(9) next, configure the disk partition

Keep the default and press the button Done to exit.

(10) configure users

The default user name on linux is root. Next we set the password for the root user to 123456. Since this is a weak password, you need to click OK twice to exit.

(11) wait for the installation to be completed and restart

(12) installation succeeded

3. Networking

At this time, the virtual machine we installed can not be connected to the Internet and can not convey our ideas. Since we did not make any settings for the virtual machine, we used the default NAT mode.

Focus the cursor on the command line window and enter the command dhclient. Wait a few seconds and run ping baidu.com to test the following network, and you can see that you can access the network normally.

The dark window above is our current Linux interface. Some people think it's ugly, just like playing dos, but hopeless people like me feel particularly kind.

For the next command, instead of taking screenshots, we will use highlighted code blocks. In order not to make people confused, please look at the following picture first.

4. External access to virtual machines

Due to the characteristics of NAT mode, our virtual machine can access the external network, but can not be discovered by the outside. The smell of wine is afraid of the depth of the alley. In order to solve this problem, we need to add another network card.

Before making these changes, you need to shut down the virtual machine first. You can force the machine to shut down, or you can enter it on the command line:

Shutdown-h now

After the virtual machine is turned off, click Settings again to switch to the Network Adapter tab. As shown in the figure, add a new network adapter with the adapter type Host-only Adapter. Through this network card, our host can access it.

Start the virtual machine again, and after executing the dhclient command, execute ip addr to check the ip address of the host. As you can see, we now have two network cards and two ip addresses.

Record 192 initial network addresses, and we will use external programs, such as XShell, SecureCRT, etc., to connect. For example, my ip address here is 192.168.99.100. No nonsense. Look at the picture.

Tip: about the network segment of the virtual network card, if there is any difference. You can change it to the same as mine in the global settings.

5. Remote connection

You may have experienced that typing through the command line interface of the virtual machine is very limited. Through the remote connection, we can switch the terminal interface to the familiar mode of operation, and it would be great to be able to display the color terminal. Here are a few tools, in general, most of them use xshell.

Windows

XShell you may have seen your SRE colleagues in the company, and the command characters are scattered like water across the screen. Even passwords that are very complicated and difficult to remember can be entered instantly. He may be using xshell.

SecureCRT is an older product and is more widely used.

MobaXterm MobaXterm is a single file pure green software, download the exe package to run directly, without any installation process.

They are all divided into free version and professional version. If you can't afford it, look for a cracked version. But note that pirated Chinese ssh clients, some people with ulterior motives will plant Trojans in the software, steal your password, certificate, this has happened many times.

MacOS

For macos users, it's easy. To use iTerm directly, enter the command line. For example, use the following command to connect to our machine.

Ssh root@192.168.99.100

This is the end of the content of "how to deploy Linux system environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for 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