在Ubuntu下如何切换到超级用户

系统 Linux
由于 Ubuntu 是基于 Debian 的 linux 操作系统,在默认的情况下,是没有超级用户(superuser, root)的,但有些系统操作必须有超级用户的权限才能进行,如手动释放内存等。

由于 Ubuntu 是基于 Debian 的 linux 操作系统,在默认的情况下,是没有超级用户(superuser, root)的,但有些系统操作必须有超级用户的权限才能进行,如手动释放内存等。

在其他 linux 操作系统 (如 fedora) 下,可以使用 su 切换到超级用户。

当输入 su 命令后, 系统会要求输入 root 的密码。

可是,在 Ubuntu 下我们根本不知道 root 的密码是什么。

这样,在 Ubuntu 下切换到超级用户需要使用其他方法,主要有两种:

1) sudo -i

sudo 是 su 的加强版,意思是 do something as the supervisor。

不需要密码就可以得到 root 的权限。

但是它也有很多限制,比如,在默认的情况下,只能在 5 分钟之内使用 root 权限。

2) 如果想一直使用 root 权限,还是要使用 su, 还是要得到 root 密码的。

用 sudo passwd root 可以设置 root 的密码。

之后就可以自由使用 su 命令啦。

【编辑推荐】

  1. 开源OS新版Ubuntu与微软Win7较劲
  2. Ubuntu创始人称赞Windows 7
  3. Windows7/Ubuntu9双系统轻松配置
责任编辑:赵宁宁 来源: chinaitlab
相关推荐

2011-09-15 14:57:49

ubunturootuser用户

2020-02-11 15:50:51

WindowsLinux命令行

2020-04-17 14:37:19

WindowsLinux微软

2022-09-29 09:58:30

Colima开源

2011-09-02 19:26:38

2009-06-23 18:19:54

NetBeans英文界面

2024-04-08 08:09:10

埋点收集数据StartRocks数据存储

2011-08-30 15:19:23

2011-08-29 16:31:30

UbuntuAndroid

2010-05-24 09:41:31

2011-01-05 09:40:33

windowslinux

2021-11-22 09:56:13

FedoraLinux

2021-08-06 15:15:09

Windows 11Dev频道Beta频道

2019-03-04 14:20:46

Ubuntu修改用户密码

2023-02-08 13:01:20

Debian测试版

2009-12-16 09:37:12

Fedora swit

2018-10-31 10:37:29

云计算迁移云平台

2020-07-27 17:32:21

Fedora 33FedoraBtrfs

2014-09-25 11:05:36

DebianGnome

2011-09-02 16:01:52

UbuntuOpenGL
点赞
收藏

51CTO技术栈公众号