Difference between pages "Package:Sudo" and "Template:Subarch"

(Difference between pages)
m (a bit better, needs individual commands saving what i've got so far)
 
 
Line 1: Line 1:
{{Ebuild
+
<includeonly>{{#widget:AddThis}}{{#if:{{{title|}}}|
|Summary=Allows users or groups to run commands as other users
+
{{DISPLAYTITLE:Download - {{{title}}}}}
|CatPkg=app-admin/sudo
+
|
|Homepage=http://www.sudo.ws/
+
{{DISPLAYTITLE:Download - {{{subarch}}}}}
}}
+
}}'''This page lists CPU-optimized builds of Funtoo Linux for {{#if:{{{title|}}}|{{{title}}} ({{{subarch}}} subarch)|{{{subarch}}}}} [[{{{CPU Family}}}]].'''
{{PageNeedsUpdates}}
+
  
sudo allows privilege escalation for non root users to perform restricted actions while in a locked down user environment.
+
{{{Description|}}}
 
+
{{#seo:
=== Emerge ===
+
|title={{#if:{{{title|}}}|Download - {{{title}}}|Download - {{{subarch}}}}}
{{console|body=###i## emerge sudo}}
+
|keywords=funtoo,linux,build,subarch,{{{subarch}}},{{{title}}}
 
+
|description=This page lists CPU-optimized builds of Funtoo Linux for {{#if:{{{title|}}}|{{{title}}} ({{{subarch}}} subarch)|{{{subarch}}}}} [[{{{CPU Family}}}]].
==== Configuration ====
+
===== /etc/sudoers.d/ =====
+
Instead of editing {{f|/etc/sudoers}}, you may drop individual configuration files into the {{f|/etc/sudoers.d/}} directory
+
 
+
===== Passwordless Sudoer =====
+
The sudo configuration file is located @ {{f|/etc/sudoers}}.  When editing this file be very careful to not introduce syntax errors.  Several other linux distributions use {{c|visudo}} to edit {{f|/etc/sudoers}}.
+
 
+
{{Console|body=$##i## su -c 'nano /etc/sudoers'}}
+
 
+
{{file|name=/etc/sudoers|lang=|desc=uncomment wheel group no password sudo|body=
+
%wheel ALL=(ALL) NOPASSWD: ALL
+
 
}}
 
}}
 
+
{{#set:CPU Family={{{CPU Family|}}}|subarch={{{subarch|}}}|CHOST={{{CHOST|}}}|CFLAGS={{{CFLAGS|}}}|USE={{{USE|}}}|CPU Features={{{CPU Features|}}}|Description={{{Description|}}}|title={{{title|}}}}}
Add your user to the wheel group to enable sudo:
+
=== Optimizations ===
 
+
__NOTOC__
{{Console|body=$##i## su -c 'gpasswd -a $USER wheel'}}
+
{{TableStart}}
 
+
<tr><td>CHOST</td><td><code>{{{CHOST|}}}</code></td></tr>
Either log out, and in again or restart:
+
<tr><td>CFLAGS</td><td><code>{{{CFLAGS|}}}</code></td></tr>
 
+
<tr><td>USE (see [[CPU_FLAGS]] for more info)</td><td>{{#if:{{{USE|}}}|<code>{{{USE}}}</code>|(none)}}</td></tr>
{{Console|body=$##i## su -c 'shutdown -r now'}}
+
{{TableEnd}}{{#vardefine:subarch|{{{subarch|}}}}}{{#get_web_data:url=http://build.funtoo.org/index.xml|format=xml|use xpath|data=builds=/subarches/subarch[@name='{{{subarch|}}}']/@builds}}{{#vardefine:builds|{{#external_value:builds}}}}
 
+
=== Download ===
===== Disabling Root Access By Password =====
+
{{#if:{{#var:builds}}|This section lists the Funtoo Linux builds currently available for download for '''{{{subarch}}}'''.  A full list of Funtoo Linux builds can be found on the [[Subarches]] page.
To better secure a system, one may desire to disable root logins by password.
+
{{table|1=
 
+
<tr><th class="active">Build</th><th class="active">Variant</th><th class="active">Latest Build</th><th class="active">Download</th><th class="active">Browse Mirror</th></tr>{{#arraymaptemplate:{{#var:builds}}|DisplayBuilds|,|}}}}|No downloadable stage builds are currently available for this sub-architecture.}}
{{console|body= $##i## sudo passwd -ld root}}
+
{{Important|Do you want a particular build of Funtoo Linux but do not see it here? Let us know what you need, and we will likely add it for you. [https://bugs.funtoo.org Create a bug report] requesting the build you need. To see what options there are, see our [[Corei7|Intel Core i7]] subarch page, which has a lot of builds listed.}}
 
+
[[Category:Subarches]]
to access root:
+
__NOEDITSECTION__
 
+
=== Detailed Description ===
{{Console|body= $##i## sudo su}}
+
</includeonly>
 
+
Root can also be accessed by logging in via ssh keys, or as a restricted user then sudo su as above.
+
 
+
====Bash Completion====
+
 
+
Users that want bash completion with sudo need to run this once.
+
 
+
{{console|body=$##i## echo "complete -cf sudo" >> $HOME/.bashrc}}
+
 
+
==== Passing Environment Variables ====
+
To pass environment variables to the temporary root use the -E flag.
+
{{console|body=$##i## sudo -E echo 'hello world'}}
+
 
+
==== Passing Aliases ====
+
If your user has aliases you wish to use under sudo you must alias sudo with a space first:
+
{{console|body=$##i## echo "alias sudo='sudo '" >> $HOME/.bashrc}}
+
 
+
{{EbuildFooter}}
+

Revision as of 00:03, March 29, 2015