如何使用 Gedit 以 Root 身份编辑文件

如何使用 Gedit 以 Root 身份编辑文件

我需要编辑实验室的文件,但我没有权限,因为它只对 root 用户开放,当我通过 root 用户时,我得到了这个

    ** (gedit:3530): WARNING **: The connection is closed

    (gedit:3530): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported


 ** (gedit:3530): WARNING **: Could not connect to session bus
[03/30/2017 16:30] root@ubuntu:/home/seed# ^C
[03/30/2017 16:31] root@ubuntu:/home/seed# gksudo gedit/etc/bind/named.config.options

 ** (gksudo:3539): WARNING **: The connection is closed

(gksudo:3539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GConf Error: No D-BUS daemon running


(gksudo:3539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GConf Error: No D-BUS daemon running


(gksudo:3539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GConf Error: No D-BUS daemon running


(gksudo:3539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GConf Error: No D-BUS daemon running


(gksudo:3539): GConf-CRITICAL **: gconf_value_free: assertion `value != NULL' failed

** (gedit:3542): WARNING **: The connection is closed

(gedit:3542): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported


** (gedit:3542): WARNING **: Could not connect to session bus

这是我获得 Root 权限后使用的命令

[03/30/2017 16:32] root@ubuntu:/home/seed# gksudo gedit /etc/bind/named.config.options

我需要将转储文件添加到选项中。如何获得访问权限?

答案1

使用CTRL + ALT + F1到达 tty

以您的用户身份登录并...

sudo su
startx

启动 Gedit

完成后退出

exit
exit

并使用CTRL + ALT + F7

相关内容