<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="gedit-admin-privileges" lang="pt_BR">

  <info>
    <link type="guide" xref="index#gedit-advanced"/>
    <desc>Access files as an administrator.</desc>
  <credit type="translator copyright"><name>Wagner Luís de Araújo Menezes Macêdo</name><email>wagnerluis1982@gmail.com</email><years>2007</years></credit><credit type="translator copyright"><name>Pedro Vaz de Mello de Medeiros</name><email>pedrovmm@gmail.com</email><years>2007</years></credit><credit type="translator copyright"><name>Leonardo Ferreira Fontenelle</name><email>leonardof@gnome.org</email><years>2007, 2008</years></credit><credit type="translator copyright"><name>Vladimir Melo</name><email>vmelo@gnome.org</email><years>2008</years></credit><credit type="translator copyright"><name>Fabricio Godoy</name><email>skarllot@gmail.com</email><years>2008</years></credit><credit type="translator copyright"><name>Krix Apolinário</name><email>krixapolinario@gmail.com</email><years>2009</years></credit><credit type="translator copyright"><name>José Carlos Menezes</name><email>jcmenezes.91@gmail.com</email><years>2013</years></credit><credit type="translator copyright"><name>Enrico Nicoletto</name><email>hiko@duck.com</email><years>2013, 2014, 2022</years></credit><credit type="translator copyright"><name>Rafael Fontenelle</name><email>rafaelff@gnome.org</email><years>2013-2020</years></credit><credit type="translator copyright"><name>Bruno Lopes</name><email>brunolopesdsilv@gmail.com</email><years>2021.</years></credit><credit type="translator copyright"><name>Giovanni dos S.A.L Rodrigues</name><email>giovannilombone.io@gmail.com</email><years>2024</years></credit></info>

  <title>Edit a file with admin privileges</title>

  <note style="warning"><p>
    Editing files with administrator privileges is potentially dangerous, and
    may break your system in bad ways. Take great care.
  </p></note>

  <p>The instructions below assume that Linux is used.</p>

  <section>
    <title>If the file needs to be created</title>
    <p>
      First, if the file doesn't exist yet, it needs to be created beforehand.
    </p>
    <p>Open a terminal and execute a command like:</p>
    <code>sudo touch <var>/path_to_file</var></code>
    <p>Replace <var>/path_to_file</var> with the desired path.</p>
    <p>Example:</p>
    <code>sudo touch /root/gedit-test</code>
  </section>

  <section>
    <title>Open an existing file</title>
    <p>
      To edit an existing text file with <app>gedit</app> with admin privileges,
      open a terminal and execute a command like:
    </p>
    <code>gedit admin://<var>/path_to_file</var></code>
    <p>Replace <var>/path_to_file</var> with the desired path.</p>
    <p>To continue the example from the previous section:</p>
    <code>gedit admin:///root/gedit-test</code>

    <note>
      <p>
        You will need to successfully enter the administrator password in order
        to open the file.
      </p>
      <p>
        The <cmd>gedit</cmd> command needs to be executed as a normal,
        unprivileged user.
      </p>
    </note>
  </section>
</page>
