[problem help] 急救:root 被锁了怎么办? Resolved
Tofloor
poster avatar
周力
deepin
2023-08-04 02:55
Author

为安排程序要使用root权限,但现在被锁了。

如图,一是不知道root密码 ,安装时也没有设置密码。二是当前用户也不是root组 。怎么办?

image.png

image.png

Reply Favorite View the author
All Replies
艾丝妲单推人
deepin
2023-08-04 03:00
#1

设置root密码用sudo passwd就可以(不需要知道原密码),不用在后面加root

Reply View the author
阿尼樱奈奈
Moderator
2023-08-04 03:00
#2

执行:sudo su

Reply View the author
周力
deepin
2023-08-04 03:01
#3
艾丝妲单推人

设置root密码用sudo passwd就可以(不需要知道原密码),不用在后面加root

image.png没用,显示work用户不是管理员组

Reply View the author
周力
deepin
2023-08-04 03:02
#4
It has been deleted!
周力
deepin
2023-08-04 03:02
#5
It has been deleted!
艾丝妲单推人
deepin
2023-08-04 03:08
#6
周力 It has been deleted!

意思是连sudo运行权限都没有(悲),试试以管理员权限在文件管理器打开文件夹,然后进入终端

想根治这个问题,建议百度,百度上这类问题的解决方案其实蛮多的

Reply View the author
周力
deepin
2023-08-04 03:11
#7
艾丝妲单推人

意思是连sudo运行权限都没有(悲),试试以管理员权限在文件管理器打开文件夹,然后进入终端

想根治这个问题,建议百度,百度上这类问题的解决方案其实蛮多的

没有root权限,无法修改/etc目录中的文件。用修复模式启动,也显示root用户被锁定,无法进入修复模式。

Reply View the author
阿尼樱奈奈
Moderator
2023-08-04 03:20
#8
周力

没有root权限,无法修改/etc目录中的文件。用修复模式启动,也显示root用户被锁定,无法进入修复模式。

去Live CD改root账户密码试试。

Reply View the author
jjcui8595
deepin
2023-08-04 03:36
#9

sudo su

Reply View the author
青稚
Moderator
2023-08-04 03:45
#10

如果是ok,应该是ok把root锁了

Reply View the author
shy
deepin
2023-08-04 04:15
#11

随便找一个linux的livecd 然后chroot进你的系统里,随后改root密码,把用户加入sudo组

推荐用archlinux

下面是一个archlinux的演示

(archlinux)#fdisk -l

找到你的系统盘,输出类似下面:


Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: WDC WDS240G2G0A-
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 97B6BEC9-6F3E-4C61-9611-0197C28588CF

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    616447    614400   300M EFI System
/dev/sda2     616448   3762175   3145728   1.5G Linux filesystem
/dev/sda3    3762176  20162559  16400384   7.8G Linux filesystem
/dev/sda4   20162560 172806143 152643584  72.8G Linux filesystem
/dev/sda5  172806144 468858879 296052736 141.2G Linux filesystem

假如你的系统盘是/dev/sdax

(archlinux)#mount /dev/sdax /mnt
(archlinux)#chroot /mnt

此时你将进入你的系统的shell

(your system)# passwd root

结束,此时你可以顺便把你的用户加入sudo组,或者过一会也行

(your system)# exit

此时回到archlinux的shell

(archlinux)#umount -v /mnt
(archlinux)#reboot
Reply View the author
delsin
deepin
2023-08-04 04:42
#12

自己用U盘做一个UOS的安装盘,ctrl+alt+f4进入其liveCD模式,然后在liveCD模式里,进入文件管理器,进入你原来的系统盘(/分区),在系统盘里用终端更改root密码。

具体可以参考我之前更改root密码的步骤:

截图_选择区域_20230803203429.png

————————————

截图_选择区域_20230803204626.png

——————————

截图_选择区域_20230803204649.png

——————————

Reply View the author
周力
deepin
2023-08-05 02:24
#13

谢谢楼上两位大佬,按你们的办法,已解决了此问题。

Reply View the author