current position:Home>Linux operating system Yum installation, uninstall and forget how to modify the root password
Linux operating system Yum installation, uninstall and forget how to modify the root password
2022-01-26 21:51:51 【Bo childe】
kali forget root How to change the password ?
First step : Select restart client
The second step : Just press the keyboard E Enter edit mode
The third step : hold ro Change to rw, Delete quiet splash, Add after init=/bin/bash
Step four : Then press ctrl+x Exit the current interface , To the interface shown in the figure below
Step five : If there's no back [email protected](none):/#, Just press enter a few times
Step six : Then input passwd, Reset new password , Entering the password will not show
Step seven : After resetting the password , restart
Step eight : After restart , The login number is root, The password is the password you just reset
CentOS_7 forget root How to change the password ?
First step : open centos7, Press... In the interface of entering the system “e” Go to the edit page .
Some have only two lines , Just choose the first line .
The second step : Find out “Linux16” Beginning line , Enter... At the end of the line “init=/bin/sh”
The third step :Ctrl+X Enter single user mode
Step four : Input “mount -o remount rw /”( Be careful mount And -o Between and rw And / There are spaces between )
Step five : Input “passwd” enter
The next step is to modify your root Account password ,( The password is not displayed when it is entered , It looks like there's no reaction , Just input it correctly and enter it
Step six :
Input touch /.autorelabel, enter
Input exec /sbin/init enter
After entering, the following interface appears , Wait here for a few minutes , The system will restart automatically
Next, wait for the system to restart and then enter to see if the modification is successful .
CentOS7、kali Update software source
CentOS7 to update yum The source is alicloud
(1) First backup /etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2) Get into yum The folder where the source configuration file is located
cd /etc/yum.repos.d/
(3) download 163 Or Alibaba cloud yum Source configuration file , Put in /etc/yum.repos.d/( Please make corresponding backup before operation , I installed. CentOS7)
163:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS7:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
(4) function yum makecache Generate cache
yum makecache
(5) Update system
yum -y update
yum repolist enabled View enabled yum Source
yum repolist all be-all yum Source
kali to update yum Source
First look at kali Files in source , There is an official source by default .(vim /etc/apt/sources.list)
Then add the domestic sources we found , Annotate the official source .( Add... To the front “#”). The following are domestic and foreign sources .
# kali Official source
deb http://http.kali.org/ moto main non-free contrib
deb-src http://http.kali.org/ moto main non-free contrib
deb http://security.kali.org/ moto/updates main contrib non-free
deb-src http://security.kali.org/ moto/updates main contrib non-free
# China University of science and technology kali Source
deb http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security kali/updates main contrib non-free
# Singapore kali Source
deb http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
deb-src http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb http://mirror.nus.edu.sg/kali/kali-security kali/updates main contrib non-free
deb-src http://mirror.nus.edu.sg/kali/kali-security kali/updates main contrib non-free
# Alibaba cloud kali Source
deb http://mirrors.aliyun.com/kali kali main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali main non-free contrib
deb http://mirrors.aliyun.com/kali-security kali/updates main contrib non-free
#163 Kali Source
deb http://mirrors.163.com/debian wheezy main non-free contrib
deb-src http://mirrors.163.com/debian wheezy main non-free contrib
deb http://mirrors.163.com/debian wheezy-proposed-updates main non-free contrib
deb-src http://mirrors.163.com/debian wheezy-proposed-updates main non-free contrib
deb-src http://mirrors.163.com/debian-security wheezy/updates main non-free contrib
deb http://mirrors.163.com/debian-security wheezy/updates main non-free contrib
# China University of science and technology
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
# Zhejiang University
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
# Neusoft University
deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
# Tsinghua University
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
The picture below is my own kali linux Source in use in .
There are several commands that will be used in the update source .
apt-get update: Update source list . If you modify the source list or want to refresh synchronously or add a new source , You should execute the above command .
apt-get upgrade: This command will attempt to download in apt All updated software packages are available on the server , Then press “y” When you install them .
apt-get dist-upgrade: This command also updates all software packages . But when upgrade update , If the dependency cannot be resolved, it may report an error or abort , But dist-upgrade The command automatically resolves dependencies . therefore dist-upgrade Software that you don't want to update may be updated , As a result, some software that needs to rely on old packages cannot run .
therefore ,apt-get dist-upgrade Use with caution . Usually use apt-get update && apt-get upgrade It can ensure the integrity of the system .
Then clean up .apt-get clean
Restart it .reboot
yum Uninstall and install software
One 、yum brief introduction
Yum( Its full name is Yellow dog Updater, Modified) It's a Fedora and RedHat as well as CentOS Medium Shell Front end package manager . be based on RPM Package management , Can be automatically downloaded from the specified server RPM Package and install , Dependency relationships can be handled automatically , And install all the dependent packages at once , No need to download it over and over again 、 install .
Two 、 frequently-used yum command
1、 Show installed packages (yum list installed)
2、 Find packages that can be installed ( With tomcat For example )(yum list tomcat)
3、 Install package ( With tomcat For example )(yum install tomcat)
4、 Uninstall package ( With tomcat For example )(yum remove tomcat)
5、 List the dependencies of the package ( With tomcat For example )(yum deplist tomcat)
6、-y Auto answer yes
When you install the software , There will be interruptions , Let the user choose whether to continue , Here's the picture :
We can use -y
To answer all yes
, For example, we install tomcat When , Use the following command , Complete the installation task at one go , It won't stop .
yum -y install tomcat
7、info Displays the description and summary of the package
With tomcat For example (yum info tomcat)
8、 Upgrade package
Upgrade all packages (yum update)
Upgrade a package , To upgrade tomcat For example (yum update tomcat)
Check for updatable programs (yum check-update)
Check the installation (rpm -qi firefox)
Basic network troubleshooting
1. The three step Ping Law
You should first understand the user or think about what you have done recently , Then take three steps Ping Law , Usually find the culprit .
- First step : First enter command line mode , adopt “ping 127.0.0.1” To judge TCP/IP Whether the protocol was successfully installed , If not, reinstall TCP/IP agreement , If the general rule goes to the next step .
- The second step : Input “ipconfig” Get the machine IP Address and gateway address , adopt “ping This machine IP Address ” To determine whether there is a problem with the network card , If Ping no , You need to reinstall the network card driver , If the general rule goes to the next step .
- The third step : Through the first two steps, it can be judged that the local network protocol and network card are working normally , The problem is the network cable , It's still on the remote server or router link . perform “ping gateway IP Address ”, If it doesn't work, the problem basically lies in the network cable , You should check RJ45 Whether the wire on the crystal head is broken , Or change a network cable to test , If the general rule indicates that the remote link connection from the local computer to the server or router is normal , The problem is the settings on the server or router , It has nothing to do with this machine .
2. Break one by one
(1) Software reasons
You may be unable to access the network due to the installation of some software , This kind of software is mainly network agent software , If you can't solve the problem by trying the above methods , Check to see if there is such software in the list of installed software , If so, consider uninstalling .
(2) Hardware reasons
- First step : Check whether the indicator of the network card is flashing or always on , Because the status display modes of various network card indicators are different , If the red light or status indicator is not on, it does not necessarily mean that there is a fault , Some network cards only flash when sending packets ( In the early ISA It is common on the network card ), Therefore, simply observing the status light can not determine that the problem lies in the hardware , Further testing is needed . use Ping Command test , If the indicator is always off during command execution , It can be preliminarily determined that it is a hardware problem .
- The second step : Check the cable , Unplug the network cable connector from the network card and information socket , Plug in the two sockets of the line measuring device , Turn on the line tester switch , If you see left and right 8 The two indicators flash in sequence , It indicates that the network cable communication is normal , If one of the indicators doesn't light up , It indicates that there is a problem with the network cable , It needs to be replaced .
linux System network troubleshooting process
- 1.ifconfig see ip Is there a problem
- 2.ping 127.0.0.1 Test the local network loop for problems
- 3.mii-tool eth0 Check whether the physical connection of the network card is normal
- 4.ping 192.168.0.1 ping The gateway tests whether the network connection is normal
- 5.tracepath 8.8.8.8 track dns
- 6.tracepath [ Website domain name ] Track whether the external connection is normal
- 7.nslookup [ Website domain name ] View the network connection path
- 8.Telnet [ Website domain name ] 80 Check the network connection port
Copy, paste and move files
One 、 File copy command cp
Command format :cp Source file Target file
Parameter description :
- -f: mandatory (force), If there is any repetition or other question , Don't ask users , And forced copying
- -r: Recursive replication , For directory copy operations
Copy file /mut/aaa To /etc/ Under the table of contents :cp /mut/aaa /etc/
Copy directory to /etc/ Under the table of contents :cp -r /mut/log/ etc
Two 、 file move 、 Rename command mv
Command format :mv [-fiu] Source file Target file
Parameter description :
- -f:force, Force to move directly without asking
- -u: If the target file already exists , And the source file is relatively new , Will update
Such as the /test1 In the catalog file1 Copied to the /test3 Catalog , And change the file name to file2, You can enter the following command :
mv /test1/file1 /test3/file2
File rename
Command format :mv File name to be modified Modified file name
3、 ... and 、 File delete command rm
Command format :rm [-fir] File or directory
Parameter description :
-f: Mandatory deletion
-i: Interactive mode , Ask the user whether to operate before deleting
-r: Recursive delete , It is often used in the deletion of a directory
Create user
useradd user name
Delete user
userdel user name
Create user group
groupadd User group name
Delete user group
groupdel User group name
To view the user
- cd /home/
- ls
Change user password
passwd user name
copyright notice
author[Bo childe],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262151493219.html
The sidebar is recommended
- Spring IOC container loading process
- [thinking] the difference between singleton mode and static method - object-oriented programming
- Hadoop environment setup (MySQL environment configuration)
- 10 minutes, using node JS creates a real-time early warning system for bad weather!
- Git tool
- Force deduction algorithm - 92 Reverse linked list II
- What is the sub problem of dynamic programming?
- C / C + +: static keyword summary
- Idea does not have the artifacts option when configuring Tomcat
- Anaconda can't open it
guess what you like
-
I don't know how to start this
-
Matlab simulation of transportation optimization algorithm based on PSO
-
MySQL slow log optimization
-
[Vue] as the window is stretched (larger, smaller, wider and higher), the text will not be displayed
-
Popular Linux distributions for embedded computing
-
Suzhou computer research
-
After installing SSL Certificate in Windows + tomcat, the domain name request is not successful. Please answer!!
-
Implementation time output and greetings of jQuery instance
-
The 72 year old uncle became popular. Wu Jing and Guo fan made his story into a film, which made countless dreamers blush
-
How to save computer research
Random recommended
- Springboot implements excel import and export, which is easy to use, and poi can be thrown away
- The final examination subjects of a class are mathematical programming, and the scores are sorted and output from high to low
- Two pronged approach, Tsinghua Professor Pro code JDK and hotspot source code notes, one-time learning to understand
- C + + recursive knapsack problem
- The use of GIT and GitHub and the latest git tutorial are easy to understand -- Video notes of crazy God speaking
- PostgreSQL statement query
- Ignition database test
- Context didn't understand why he got a high salary?, Nginxfair principle
- Bootstrap switch switch control user's guide, springcloud actual combat video
- A list that contains only strings. What other search methods can be used except sequential search
- [matlab path planning] multi ant colony algorithm grid map path planning [including GUI source code 650]
- [matlab path planning] improved genetic algorithm grid map path planning [including source code phase 525]
- Iinternet network path management system
- Appium settings app is not running after 5000ms
- Reactnative foundation - 07 (background image, status bar, statusbar)
- Reactnative foundation - 04 (custom rpx)
- If you want an embedded database (H2, hsql or Derby), please put it on the classpath
- When using stm32g070 Hal library, if you want to write to flash, you must perform an erase. If you don't let it, you can't write continuously.
- Linux checks where the software is installed and what files are installed
- SQL statement fuzzy query and time interval filtering
- 69. Sqrt (x) (c + + problem solving version with vs runnable source program)
- Fresh students are about to graduate. Do you choose Java development or big data?
- Java project: OA management system (java + SSM + bootstrap + MySQL + JSP)
- Titanic passenger survival prediction
- Vectorization of deep learning formula
- Configuration and use of private image warehouse of microservice architect docker
- Relearn JavaScript events
- For someone, delete return 1 and return 0
- How does Java dynamically obtain what type of data is passed? It is used to judge whether the data is the same, dynamic data type
- How does the database cow optimize SQL?
- [data structure] chain structure of binary tree (pre order traversal) (middle order traversal) (post order traversal) (sequence traversal)
- Webpack packaging optimization solution
- 5. Operation element
- Detailed explanation of red and black trees
- redhat7. 9 install database 19C
- Blue Bridge Cup notes: (the given elements are not repeated) complete arrangement (arrangement cannot be repeated, arrangement can be repeated)
- Detailed explanation of springboot default package scanning mechanism and @ componentscan specified scanning path
- How to solve the run-time exception of test times
- Detailed explanation of k8s management tool kubectl
- Android system view memory command