Technology Sharing

Wang's Linux C Communication Architecture Notes (II) Configure the server to have a fixed IP address, remote login, install gcc g and share virtual machine folders

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

(7) This entry starts configuring the fixed IP address of Linux for use as a server:

First explain the Linux network port number:

insert image description here

Linux command cd: change directory changes directory. ls: list lists the files in a directory
Root directory file name /etc: editable text Configuration The files in this directory are used to configure the IP address.

No longer use the original DHCP protocol of the Linux network port:

insert image description here

Linux command: cd /etc/network
sudo vim interfaces enters the following interface:

insert image description here
Add a static address:

insert image description here

The above image is wrong: the dhcp line should be commented out.
Next, you need to configure the domain name server address for the server:

insert image description here

Use the Linux command to configure the domain name server address: sudo vim /etc/resolvconf/resolv.conf.d/base

insert image description here
Increase:

insert image description here
Then restart the Linux operating system: reboot. Use administrator privileges sudo reboot

insert image description here

Test whether you can access the Internet: ping www.baidu.com

insert image description here

If you keep pinging the URL and can't stop, you can use ctrl + c to end the infinite ping operation of the virtual machine Linux.
And the host windows of the virtual machine can also ping this server:

insert image description here

(8) Then configure to log in to the server remotely

First understand the command ps:
insert image description here

Next, learn the pipeline command |:

insert image description here

Next, learn the grep command:

insert image description here

We first use the ps - e | grep ssh command to check whether there is an ssh service on the virtual machine. If not, install it.

insert image description here

So what is ssh?

insert image description here

Install ssh command: sudo apt-get install openssh-server

insert image description here

In this way, you can use the ssh client to remotely log in to the server. And after the server restarts, the ssh will automatically start. xshell can be installed without any brains, except for changing the installation location:

insert image description here
About the new connection of xshell:

insert image description here

Then:

insert image description here
+

![Insert image description here](https://i-blog.csdnimg.cn/direct/4173dcb610704bbfbc8ba64476b82a1a.png
+
insert image description here
+
insert image description here

xshell has stronger support for keyboard and mouse.

insert image description here

(9) Install gcc and g++ for the virtual machine. These two software are not available on the newly installed Ubuntu:

insert image description here
First install the lower-level software that the compilation software depends on, command: sudo apt-get install build-essential:

insert image description here

What is build-essential?

insert image description here
as well as

insert image description here

(10) Realize file sharing between Linux virtual machine and carrier winddos:

One way is to use the samba service:

insert image description here

The above method also needs to be configured.

On the virtual machine, share with the host machine:


+
insert image description here
+
insert image description here
+
insert image description here
+
insert image description here
+
insert image description here

turn out:

insert image description here
And the test:

insert image description here

Introducing the cat command:

insert image description here

Thanks