{"id":1851,"date":"2013-10-07T08:31:08","date_gmt":"2013-10-07T08:31:08","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=1851"},"modified":"2013-10-07T08:31:08","modified_gmt":"2013-10-07T08:31:08","slug":"open-as-administrator-to-pantheon-elementary-os","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2013\/10\/open-as-administrator-to-pantheon-elementary-os\/","title":{"rendered":"Add &#8216;Open as Administrator&#8217; to Pantheon in Elementary OS Luna"},"content":{"rendered":"<p><b>This simple tutorial will show you how to add &#8216;Open as Administrator&#8217; or &#8216;Open as root&#8217; to Pantheon Context menu in Elementary OS Luna.<\/b> So that you can easily open system files or folders with super user privilege through the default Pantheon file browser.<\/p>\n<p>First take a look at the screenshots:<\/p>\n<div id=\"attachment_1852\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-file-as-root-eos.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1852\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-file-as-root-eos.jpg\" alt=\"open file as root in elementary os\" width=\"560\" height=\"328\" class=\"size-full wp-image-1852\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-file-as-root-eos.jpg 560w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-file-as-root-eos-300x175.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-1852\" class=\"wp-caption-text\">open file as root in elementary os<\/p><\/div>\n<div id=\"attachment_1853\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-folder-as-root-eos.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1853\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-folder-as-root-eos.jpg\" alt=\"open folder as root in elementary os\" width=\"560\" height=\"297\" class=\"size-full wp-image-1853\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-folder-as-root-eos.jpg 560w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2013\/10\/open-folder-as-root-eos-300x159.jpg 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-1853\" class=\"wp-caption-text\">open folder as root in elementary os<\/p><\/div>\n<p>Before getting started, search for and install <b>gksu<\/b> from Software Center. It is a Gtk+ frontend allows graphical programs to ask a user&#8217;s password to run another program as root \/ administrator.<\/p>\n<h3>Open files as root in Panthen Context Menu:<\/h3>\n<p>It&#8217;s a little different to Ubuntu Nautilus. Because I don&#8217;t know how to use <i>if conditional statements<\/i> in &#8216;.contractor&#8217; files, so I divided this into two parts: <b>Open files as root<\/b> and <b>Open folders as root<\/b>.<\/p>\n<p>1. Use your favorite editor to create and edit the config file. Here I use gedit (press <u>Ctrl+Alt+T<\/u> to open terminal for running commands):<\/p>\n<pre>sudo apt-get install gedit\n\nsudo gedit \/usr\/share\/contractor\/scratch-openasroot.contract<\/pre>\n<p>2. Copy and paste below lines into the file and save it.<\/p>\n<blockquote><p>[Contractor Entry]<br \/>\nName=Open file as root<br \/>\nIcon=scratch-text-editor<br \/>\nDescription=open file as root with scratch<br \/>\nMimeType=text<br \/>\nExec=gksudo scratch-text-editor %U<br \/>\nGettext-Domain=scratch-text-editor<\/p><\/blockquote>\n<p>This will add an option &#8220;Open file as root&#8221; to Pantheon context menu, which open text files as root user with Scratch Text Editor (the default editor for eOS). <\/p>\n<h3>Open folders as root in Panthen Context Menu:<\/h3>\n<p>1. Use your favorite editor to create and edit the config file:<\/p>\n<pre>sudo gedit \/usr\/share\/contractor\/folder-openasroot.contract<\/pre>\n<p>2. Copy and paste below lines into the file and save it.<\/p>\n<blockquote><p>[Contractor Entry]<br \/>\nName=Open folder as root<br \/>\nIcon=pantheon-files<br \/>\nDescription=Open current folder as root privilege<br \/>\nMimeType=inode;<br \/>\nExec=gksudo pantheon-files %U<br \/>\nGettext-Domain=pantheon-files<\/p><\/blockquote>\n<p>This adds the option &#8216;Open folder as root&#8217; to context menu, which open folders as root privilege.<\/p>\n<p>Remember, you need a restart to get things done. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial will show you how to add &#8216;Open as Administrator&#8217; or &#8216;Open as root&#8217; to Pantheon Context menu in Elementary OS Luna. So that you can easily open system files or folders with super user privilege through the default Pantheon file browser. First take a look at the screenshots: Before getting started, search [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[435,670,671],"class_list":["post-1851","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-elementary-os-luna","tag-open-as-administrator","tag-open-as-root"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/1851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=1851"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/1851\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}