---
title: "ubuntu中获取root权限"
author: "cserw3c"
date: "2014-11-19T17:58:26Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-root"
draft: false
lastmod: "2014-11-19T17:59:59Z"
id: 2158197
url: "https://solomon2012.iteye.com/blog/2158197"
---

## [UBUNTU中如何获得root权限](/blog/2158197 "ttt")

在终端中输入：  
**sudo passwd root**  
Enter new UNIX password: (在这输入你的密码）  
Retype new UNIX password: (确定你输入的密码）  
passwd: password updated successfully

以后，如果在想获得root权限，只需进行如下的操作：  
**su root**  
**Password**: (在此输入你上面设置的密码）

如果要再次禁用 root 帐号，

那么可以执行 **sudo passwd -l root**