mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
commit
bf6d41ccff
@ -1,56 +0,0 @@
|
||||
translating---geekpi
|
||||
|
||||
How to enter single user mode in SUSE 12 Linux?
|
||||
======
|
||||
Short article to learn how to enter single user mode in SUSE 12 Linux server.
|
||||
|
||||
![How to enter single user mode in SUSE 12 Linux][1]
|
||||
|
||||
In this short article we will walk you through steps which demonstrate how to enter single user mode in SUSE 12 Linux. Single user mode is always preferred when you are troubleshooting major issues with your system. Single user mode disables networking and no other users are logged in, you rule out many situations of multi user system and it helps you in troubleshooting fast. One of the most popular use of single user mode is to [reset forgotten root password][2].
|
||||
|
||||
### 1\. Halt boot process
|
||||
|
||||
First of all you need have console of your machine to get into single user mode. If its VM then VM console, if its physical machine then you need its iLO/serial console connected. Reboot system and halt automatic booting of kernel at grub boot menu by pressing any key.
|
||||
|
||||
![Kernel selection menu at boot in SUSE 12][3]
|
||||
|
||||
### 2\. Edit boot option of kernel
|
||||
|
||||
Once you are on above screen, press `e` on selected kernel (which is normally your preferred latest kernel) to update its boot options. You will see be below screen.
|
||||
|
||||
![grub2 edits in SUSE 12][4]
|
||||
|
||||
Now, scroll down to your booting kernel line and add `init=/bin/bash` at the end of the line as shown below.
|
||||
|
||||
![Edit to boot in single user shell][5]
|
||||
|
||||
### 3\. Boot kernel with edited entry
|
||||
|
||||
Now press `Ctrl-x` or `F10` to boot this edited kernel. Kernel will be booted in single user mode and you will be presented with hash prompt i.e. root access to server. At this point of time, your root file system is mounted in read only mode. So any changes you are doing to system wont be saved.
|
||||
|
||||
Run below command to remount root filesystem as re-writable.
|
||||
|
||||
```
|
||||
kerneltalks:/ # mount -o remount,rw /
|
||||
```
|
||||
|
||||
And you are good to go! Go ahead and do your necessary actions in single user mode. Dont forget to reboot server to boot into normal multiuser mode once you are done.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://kerneltalks.com/howto/how-to-enter-single-user-mode-in-suse-12-linux/
|
||||
|
||||
作者:[kerneltalks][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://kerneltalks.com
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://a4.kerneltalks.com/wp-content/uploads/2018/11/How-to-enter-single-user-mode-in-SUSE-12-Linux.png
|
||||
[2]: https://kerneltalks.com/linux/recover-forgotten-root-password-rhel/
|
||||
[3]: https://a1.kerneltalks.com/wp-content/uploads/2018/11/Grub-menu-in-SUSE-12.png
|
||||
[4]: https://a3.kerneltalks.com/wp-content/uploads/2018/11/grub2-editor.png
|
||||
[5]: https://a4.kerneltalks.com/wp-content/uploads/2018/11/Edit-to-boot-in-single-user-shell.png
|
@ -0,0 +1,54 @@
|
||||
如何在 SUSE 12 Linux 中进入单用户模式?
|
||||
======
|
||||
一篇了解如何在 SUSE 12 Linux 服务器中进入单用户模式的简短文章。
|
||||
|
||||
![How to enter single user mode in SUSE 12 Linux][1]
|
||||
|
||||
在这篇简短的文章中,我们将向你介绍在 SUSE 12 Linux 中进入单用户模式的步骤。在排除系统主要问题时,单用户模式始终是首选。单用户模式禁用网并且没有其他用户登录,你可以排除许多多用户系统的情况,可以帮助你快速排除故障。单用户模式最常见的一种用处是[重置忘记的 root 密码][2]。
|
||||
|
||||
### 1\. 暂停启动过程
|
||||
|
||||
首先,你需要拥有机器的控制台才能进入单用户模式。如果它是 VM 就要 VM 控制台,如果它是物理机那么你需要连接它的 iLO/串口控制台。重启系统并按任意键停止 grub 启动菜单中的内核自动启动。
|
||||
|
||||
![Kernel selection menu at boot in SUSE 12][3]
|
||||
|
||||
### 2\. 编辑内核的启动选项
|
||||
|
||||
进入上面的页面后,在所选内核(通常是你首选的最新内核)上按 “e” 更新其启动选项。你会看到下面的页面。
|
||||
|
||||
![grub2 edits in SUSE 12][4]
|
||||
|
||||
现在,向下滚动到内核引导行,并在行尾添加 `init=/bin/bash`,如下所示。
|
||||
|
||||
![Edit to boot in single user shell][5]
|
||||
|
||||
### 3\. 引导编辑后的内核
|
||||
|
||||
现在按 `Ctrl-x` 或 `F10` 来启动这个编辑过的内核。内核将以单用户模式启动,你将看到井号提示符,即有服务器的 root 访问权限。此时,根文件系统以只读模式挂载。因此,你对系统所做的任何更改都不会被保存。
|
||||
|
||||
运行以下命令以将根文件系统重新挂载为可重写入的。
|
||||
|
||||
```
|
||||
kerneltalks:/ # mount -o remount,rw /
|
||||
```
|
||||
|
||||
这就完成了!继续在单用户模式中做你必要的事情吧。完成后不要忘了重启服务器引导到普通多用户模式。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://kerneltalks.com/howto/how-to-enter-single-user-mode-in-suse-12-linux/
|
||||
|
||||
作者:[kerneltalks][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://kerneltalks.com
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://a4.kerneltalks.com/wp-content/uploads/2018/11/How-to-enter-single-user-mode-in-SUSE-12-Linux.png
|
||||
[2]: https://kerneltalks.com/linux/recover-forgotten-root-password-rhel/
|
||||
[3]: https://a1.kerneltalks.com/wp-content/uploads/2018/11/Grub-menu-in-SUSE-12.png
|
||||
[4]: https://a3.kerneltalks.com/wp-content/uploads/2018/11/grub2-editor.png
|
||||
[5]: https://a4.kerneltalks.com/wp-content/uploads/2018/11/Edit-to-boot-in-single-user-shell.png
|
Loading…
Reference in New Issue
Block a user