[Linux] Common commands for getting started with Linux

introduce

This is the journey of the editor's growth path, and also the editor's learning path. Hope to grow up with you guys!

Here are two of my favorite quotes:

To have the most simple life and the most distant dream, even if it will be cold tomorrow, the mountains will be high and the water will be far away, and the road will be far away.

Why should one work hard? The best answer I have ever seen is: because the things I like are expensive, the places I want to go are far away, and the person I love is perfect. Therefore, the editor would like to say: encourage each other!

This article is a small editor to record the systematic learning of Linux

Table of contents

1. What is Linux?

2. What are the Linux kernel operating systems?

Red Hat

hundred

Red Flag Linux

suse (chameleon)

Ubuntu (Ubantu, Youbantu, Youbangtuo)

Three, Linux directory structure

4. SSH

1. What is the concept of SSH tools commonly used in Linux?

2. What is SSH?

 3. What is the port number of SSH?

Five, the meaning of different colors in Linux

6. Linux commands

1. Use the root user to log in to the graphical interface setting method

1. Open the terminal

2. Why use the root account?

3. The command to open the configuration file as an administrator is as follows:

 Step 1: Enter the commandEdit

Step 2: Modify the configuration

 Step 3: Enter the following command to reset the root password

Step 4: Test whether you can enter the root user

su username switch account

2. Sudo run command as administrator

Three, gedit edit file

Four, passwd user name change password

5. Commands about ssh

1. Install the ssh server

 2. Install the ssh client

3. Configure the ssh client

Six, ifconfig view ip address

7. Command --help view help command

8. Commands about apt

7. Use the MobaXterm backup tool

1. Official website 

Link: https://pan.baidu.com/s/1M1Ny07LWwK_uHX_sEn9FWg?pwd=tb78 Extraction code: tb78 

2. Obtain the ip address in Ubuntu

3. Create a new session

 4. Enter root and root password


1. What is Linux?

  • Linux is based on Unix
  • Linux is a free and open source operating system. There are many different Linux versions, but they all use the Linux kernel.
  • Linux can be installed in various computer hardware devices, such as mobile phones, tablet computers, routers, and desktop computers (such as the Android operating system used by Xiaomi and Huawei)

2. What are the Linux kernel operating systems?

Red Hat

Red Hat (Red Hat) Corporation (NYSE: RHT) is an open source solutions provider and a member of the S&P 500 Index . Headquartered in Raleigh, North Carolina, USA , as of June 2022, Red Hat has more than 100 branches with more than 20,000 employees worldwide. [36]  Red Hat provides mission-critical software and services for many important IT technologies such as operating systems, storage, middleware , virtualization and cloud computing . Red Hat's open source model provides enterprise computing solutions across physical, virtual and cloud environments to help businesses reduce costs and improve performance, stability and security. Red Hat also provides technical support , training and consulting services to customers around the world or through leading partners . 

hundred

CentOS (Community Enterprise Operating System, which means community enterprise operating system in Chinese) is one of the Linux distributions. It is a free, open source, and redistributed open source operating system  [1]   .

The CentOS Linux distribution is a stable, predictable, manageable and reproducible platform derived from Red Hat Enterprise Linux ( RHEL ) released in accordance with open source code (mostly GPL open source agreement [2]   ) compiled from source code.

Since March 2004, CentOS Linux has been a community-driven open source project designed to be functionally compatible with RHEL .

Red Flag Linux

Red Flag Linux is a series of Linux distributions developed by Beijing Zhongke Hongqi Software Technology Co., Ltd. , including desktop version, workstation version, data center server version, HA cluster version and Red Flag Embedded Linux and other products. Red Flag Linux is one of the larger and more mature Linux distributions in China. It was acquired by Dalian Wujia Wanjing Information Technology Industry Group in 2014 [1]   .

suse (chameleon)

SuSE Linux is a linux version released and maintained by SuSE Linux AG in Germany. Different from the open source linux operating system (such as CentOS/Ubuntu, etc.), this is an enterprise-level commercial linux operating system. The original SuSE factory continuously develops and improves this version of the operating system. At the same time, it also provides technical support services for users

Ubuntu (Ubantu, Youbantu,  Youbangtuo )

Ubuntu is a Linux operating system mainly based on desktop applications . Its name comes from the word "ubuntu" in Zulu or Hausa in southern Africa , which means "humanity" and "I exist because everyone exists". A traditional value. Ubuntu is based on the Debian distribution and the Gnome desktop environment , and from version 11.04, the Ubuntu distribution has abandoned the Gnome desktop environment and changed to Unity. In the past, people thought that Linux was difficult to install and difficult to use. After the emergence of Ubuntu, these have become history. Ubuntu also has a huge community power, and users can easily get help from the community. [1]  Since Ubuntu 18.04 LTS , the Ubuntu distribution has started to use the GNOME3 desktop environment again. 

Of course, in addition to the above five, there are other Linux kernel operating systems. If you want to know more, you can go to Baidu, or read the articles of other bloggers.

Three, Linux directory structure

4. SSH

1. What is the concept of SSH tools commonly used in Linux?

Remote access: xshell tool , Putty, SSH, SecureCRT, moba all support SSH remote protocol (a security protocol specially provided for remote connection, session and other network services)

2. What is SSH?

Simply put, SSH is a network protocol for encrypted logins between computers. If a user logs in to another remote computer using the SSH protocol from a local computer, we can assume that this login is safe, even if it is intercepted midway, the password will not be revealed.

To explain in detail, SSH (Secure Shell) is a network security protocol that implements secure access and file transfer services through encryption and authentication mechanisms. Traditional remote login or file transfer methods, such as Telnet and FTP, use clear text to transfer data, and there are many security risks. With people's emphasis on network security, these methods have gradually become unacceptable. The SSH protocol provides secure login and other secure network services in an insecure network environment by encrypting and verifying network data. As a secure alternative to Telnet and other insecure remote shell protocols, the SSH protocol has been widely used all over the world, and most devices support the SSH function.

 3. What is the port number of SSH?

When SSH is applied to STelnet, SFTP and SCP, the default SSH port used is 22. When SSH is applied to NETCONF , the SSH port can be specified as 22 or 830. The SSH port supports modification. After the change, all current connections will be disconnected, and the SSH server will start listening to the new port.

For a detailed introduction to SSH, you can read the following article. These two bloggers wrote very detailed

What is SSH? How does SSH work? - Huawei (huawei.com)

Five, the meaning of different colors in Linux

Light blue : indicates linked files ;
 gray : indicates other files;

 Green : indicates executable files;
 red : indicates compressed files; 
 blue : indicates directories; 

 Flashing red: indicates that there is a problem with the linked file; (I don’t know how to express this color, so I won’t change the color)
Yellow : indicates device files, including block, char, fifo

6. Linux commands

1. Use the root user to log in to the graphical interface setting method

1. Open the terminal

The font in the terminal is relatively small, we can use the shortcut key Ctrl+Shift plus + (Ctrl+Shift plus a plus sign to enlarge the font)

Ctrl plus - (Ctrl plus a minus sign, reduces font)

2. Why use the root account ?

Ubuntu does not enable the root user by default, but centerOS is the default root user

Ubuntu Ubuntu  By default, the root user cannot log in to the graphical interface, and can only log in to the graphical interface as other users . This is very troublesome, because of permission issues, you cannot copy and delete files at will. When editing files with gedit, you often cannot save them, and you can only edit them with vim.

3. Open the configuration file as an administrator.
The command is as follows:

sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

 Step 1: Enter the command

Step 2: Modify the configuration

 Enter, the following interface appears

Type the following code on the last line

greeter-show-manual-login=true

 After the setting is complete, the following warning may appear, but if you open the configuration file again, the modified content will still be saved (so don’t worry about it)

 Step 3: Enter the following command to reset the root password

sudo passwd root 

 

Step 4: Test whether you can enter the root user

su root

su - root

su username switch account

The root user is the highest authority

2. Sudo run command as administrator

When some commands execute and report errors, you can use sudo, which is equivalent to administrator privileges

Three, gedit edit file

 

Click on other documents and select the file to be edited

Four, passwd user name change password

eg : passwd root      If you are already under the root user, directly enter passwd as shown in the figure below

(The password here is hidden, so you need to remember what you entered)

5. Commands about ssh

1. Install the ssh server

安装ssh服务器
sudo apt install openssh-server

 2. Install the ssh client

安装ssh客户端
sudo apt install openssh-client

3. Configure the ssh client

 Enter the configuration file of ssh

使用vim编辑器
sudo vim /etc/ssh/sshd_config

使用gedit
gedit /etc/ssh/sshd_config

The premise of using vim is to download the vim editor, you can look down and use gedit to edit ( note that you need to use the root account )

To operate in vim, press "esc" to enter the command line, then use "i" to enter, press "esc" again to exit the command line, and use ":wq" to save and exit (the editor vim will be discussed in detail in subsequent articles In the operation, here is just a brief introduction)

 If you don’t know whether the ssh download is successful or whether it is started, you can use the following command to verify

  • service ssh status View ssh service status
  • service ssh start Start the ssh service
  • service ssh restart Restart the ssh service
  • ssh root@IP address Determine whether the ssh tool can connect to the server
  • The following commands can only be executed with administrator privileges
  • # /etc/init.d/ssh stop //stop
    # /etc/init.d/ssh start //start
    # /etc/init.d/ssh restart //restart

Six, ifconfig view ip address

7. Command --help view help command

The following is an example of apt

8. Commands about apt

apt-get update software name update software

apt-get install software name install software 

apt-get install vim install vim

apt list --upgradeable Query updatable packages

apt list --installed Query installed software

apt upgrade upgrade package

apt install -f fix dependencies

apt remove vim uninstall VIM software

apt autoremove is used to automatically clean up dependencies and library files that are no longer used.

apt show <package name> displays specific information about the package

The above commands try to use the administrator account to operate, and the administrator account does not need to use sudoelevated privileges. Ordinary users pay attention to add in front sodo.

7. Use the MobaXterm backup tool

MobaXterm backup hereinafter referred to as moba

1. Official website 

MobaXterm Xserver with SSH, telnet, RDP, VNC and X11 - Download

Link: https://pan.baidu.com/s/1M1Ny07LWwK_uHX_sEn9FWg?pwd=tb78 
Extraction code: tb78 

2. Obtain the ip address in Ubuntu


3. Create a new session

 

 4. Enter root and root password

When the following interface appears, the test is successful, and the password will not be displayed when you enter it, so pay attention to the password you enter

All the commands used in linux can be used in moba, so I won’t demonstrate them here

Note: moba is a tool for remote connection. If you cannot connect, you can check whether the bridge mode is enabled (equivalent to virtualizing a computer independently, which is in parallel with the host). Generally, it is possible to connect. Set it to The bridge mode needs to restart the virtual machine to refresh the configuration! ! !

You can take a look at the editor's next article on Linux commands:

[Linux] Common commands for getting started with Linux 2_determine ZandR's blog - CSDN blog icon-default.png?t=N3I4https://blog.csdn.net/weixin_60387745/article/details/130546528?spm=1001.2014.3001.5501

The above is the content of the editor's practice, I hope it can help everyone, thank you for watching! ! !

Reference article:

What is SSH? How does SSH work? - Huawei (huawei.com) https://info.support.huawei.com/info-finder/encyclopedia/zh/SSH.html

Guess you like

Origin blog.csdn.net/weixin_60387745/article/details/130519885