المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : السي بانال WHM/cPanel فقدان باسورد السيرفر Alma Linux rescue mode reset root password



Rise Company
22-01-2024, 04:08
السي بانال WHM/cPanel فقدان باسورد السيرفر Alma Linux rescue mode reset root password
فقدان باسورد السيرفر- كيفية تغيير باسورد سيرفر لينكس من خلال الشل
How To Reset Root Password on AlmaLinux
Reset root Password On OVH Dedicated Server

https://www.rise.company/forum/images/imported/2024/01/1.webp (https://orcacore.com/wp-content/uploads/2022/12/reset-root-pass-alma9.webp)

In this guide, we intend to teach you How To Reset or Recover the Lost or Forgotten Root Password on AlmaLinux 9.
In Linux, root privileges (or root access) refer to a user account that has full access to all files, applications, and system functions.

Most basic Linux user accounts run with limited privileges. This keeps users from making mistakes or accidentally exposing the system to vulnerabilities.

To use protected operating system features, a Linux user has to temporarily elevate their privileges using a command like sudo. The sudo command tells the system to run a command as a superuser, or root user. When you run a function using sudo, you’ll usually have to enter your password.
If you forget your root password, you can easily follow the steps below to recover it on AlmaLinux 9.

what you read in this post?

Steps To Reset Root Password on AlmaLinux 9
Recover Lost Root Password from the Grub Menu
Root Shell Access on AlmaLinux 9
Change Root Password on AlmaLinux 9
Conclusion

Steps To Reset Root Password on AlmaLinux 9

In this guide, we will show you to Recover Lost Root Password from the Grub Menu (https://www.gnu.org/software/grub/manual/grub/grub.html) on AlmaLinux 9.
Follow the steps below to complete this guide.

Recover Lost Root Password from the Grub Menu

First, you need to restart your system, and while doing that press and hold the Shift key on your Keyboard. This will drop you into the Grub menu of AlmaLinux 9.
Next, you need to press the ‘e’ key on your keyboard. This will let you edit the Grub’s boot prompt. Don’t touch or delete anything here. Once you have the editor move to the next step.
At this point, use your arrow key and move to the end of the line starting with “Linux“. After the root ro line, type rw init=/bin/bash.


rw init=/bin/bash

https://www.rise.company/forum/images/imported/2024/01/2.webp

Grub Menu AlmaLinux 9After adding the syntax, boot your system with this configuration. To do this, you can use Ctrl+X or F10.

Root Shell Access on AlmaLinux 9

At this point, without providing any password you will have an AlmaLinux 9’s shell with root access.
First, let’s check whether your user has read and write access to the file system where the OS has been installed.
To do this, run the following command:

mount | grep -w /

If you see (rw,realtime) in your output, it means you have real-time read and write access to the file system.

Change Root Password on AlmaLinux 9

Now you can simply change your root password on AlmaLinux 9 with the following command:

passwdThe system will prompt you to add a new password two times.
To change the password of some other user than root, we have to mention the username of the same. The syntax is like the following command:
passwd usernameWhen you are done resetting your Linux password, restart your system to log in with the changed password. For rebooting, run the command below:

exec /sbin/init
After that, hit the Enter key.
From here, you can log in and access your system with the newly set root password.

--------------------------------------------------
طريقة اخرى من خلال البوت وليس rescue
--------------------------------------------------

Almalinux 8
In the Virtual Console window navigate to the upper menu and hit Macro » Ctrl + Alt + Delete to reboot the server. After the installation reboots, it will come up to a boot countdown. Here, you can press any key to get to the GRUB menu (https://en.wikipedia.org/wiki/GNU_GRUB). You will see a GRUB boot prompt. Press e on the keyboard to edit the first boot option.

https://www.rise.company/forum/images/imported/2024/01/67.png

Using arrow keys find the kernel line that starts with linux and edit it. You will need to delete rhgb quiet at the end of the line and add rd.break enforcing=0 instead.

https://www.rise.company/forum/images/imported/2024/01/68.png

Press Ctrl + X to boot single-user mode. First, we need to add the read and write access to the sysroot filesystem:



mount -o remount,rw /sysroot


Make sure to add a space between the mount and -o and between rw and /.

Now you can access the system with the command:



chroot /sysroot


And use the passwd command typing the new password twice to set a new password.

PLEASE NOTE: It is not possible to copy/paste in this window.

https://www.rise.company/forum/images/imported/2024/01/69.png

https://www.rise.company/forum/images/imported/2024/01/70.png

Type exit to exit sysroot.

Reboot the server using the reboot -f command. Now that you can log into the server over SSH or a control panel, you’ll be able to set up a new more secure root password.

https://youtu.be/O8vZ4gkWEmQ

المرجع:
https://orcacore.com/reset-root-password-almalinux-9/
https://www.namecheap.com/support/knowledgebase/article.aspx/10084/2188/resetting-dedicated-server-root-password-via-virtual-console/?_ga=2.34213345.1309254629.1704555104-333307646.1704555104
https://help.ovhcloud.com/csm/en-dedicated-servers-root-password?id=kb_article_view&sysparm_article=KB0043633