<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sudoers file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sudoers-file/m-p/6217175#M485392</link>
    <description>&lt;P&gt;Line 1:&lt;/P&gt;&lt;P&gt;&amp;gt; User_Alias ADMINS = user1, user2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This defines an "user alias": a collective name for a set of one or more users, for the purpose of identifying the users who can do something with sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are other alias types: Host_Alias for defining a set of hosts, Runas_Alias for defining a set of users someone can run commands as, and Cmnd_Alias for defining a set of commands you might allow to be run through sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't *have* to use any of these aliases, but if your sudo configuration is complex, the aliases will allow you to group things so you don't have to repeat long lists of users/hosts/commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 2:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;FONT color="#FF0000"&gt;root&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#99CC00"&gt;ALL&lt;/FONT&gt; = (&lt;FONT color="#800080"&gt;ALL&lt;/FONT&gt;) &lt;FONT color="#0000FF"&gt;ALL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the basic form of a sudoers user specification.&lt;/P&gt;&lt;P&gt;It says that &lt;FONT color="#FF0000"&gt;root&lt;/FONT&gt; is allowed to use sudo &lt;FONT color="#99CC00"&gt;on all hosts using this sudoers file&lt;/FONT&gt;, to &lt;FONT color="#0000FF"&gt;run all possible commands&lt;/FONT&gt;, &lt;FONT color="#800080"&gt;as any user&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When a sudoers file is used on a single host, most sysadmins won't bother using the actual hostname in the hosts field; they will type "ALL" in the host field instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have a centrally managed sudoers file that is used on multiple hosts, you can use the hosts field to restrict some sudoers user specifications to a particular (set of) host(s) only.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Line 3:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;FONT color="#FF0000"&gt;ADMINS&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;ALL&lt;/FONT&gt; = NOPASSWD: &lt;FONT color="#0000FF"&gt;ALL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is another user specification, using the ADMINS user alias defined on line 1.&lt;/P&gt;&lt;P&gt;It also has the NOPASSWD tag, indicating that no password prompt will be presented before running the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The users listed by the ADMINS user alias may run &lt;FONT color="#0000FF"&gt;all commands&lt;/FONT&gt; as root (if the run-as field is omitted, the default value of &lt;FONT color="#800080"&gt;&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;root&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/FONT&gt; is assumed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, line 3 could is exactly equivalent to:&lt;/P&gt;&lt;PRE&gt;user1, user2 ALL = (root) NOPASSWD: ALL&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might want to write a comment like this as a syntax reminder to your sudoers file:&lt;/P&gt;&lt;PRE&gt;# &amp;lt;WHO does&amp;gt; &amp;lt;WHERE&amp;gt; = (&amp;lt;as WHO&amp;gt;) &amp;lt;WHAT&amp;gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2013 19:10:19 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2013-09-25T19:10:19Z</dc:date>
    <item>
      <title>sudoers file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudoers-file/m-p/6216927#M485391</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;User_Alias&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADMINS =&amp;nbsp; user1, user2&lt;BR /&gt;root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALL = (ALL) ALL&lt;BR /&gt;ADMINS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALL = NOPASSWD: ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt; 1.Can you explain me the Line 1,2 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt; 2.suppose if i am adding user3 instead of root in Line 2 ,at this point what it refers to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2013 15:22:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudoers-file/m-p/6216927#M485391</guid>
      <dc:creator>tempsample</dc:creator>
      <dc:date>2013-09-25T15:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: sudoers file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudoers-file/m-p/6217175#M485392</link>
      <description>&lt;P&gt;Line 1:&lt;/P&gt;&lt;P&gt;&amp;gt; User_Alias ADMINS = user1, user2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This defines an "user alias": a collective name for a set of one or more users, for the purpose of identifying the users who can do something with sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are other alias types: Host_Alias for defining a set of hosts, Runas_Alias for defining a set of users someone can run commands as, and Cmnd_Alias for defining a set of commands you might allow to be run through sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't *have* to use any of these aliases, but if your sudo configuration is complex, the aliases will allow you to group things so you don't have to repeat long lists of users/hosts/commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 2:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;FONT color="#FF0000"&gt;root&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#99CC00"&gt;ALL&lt;/FONT&gt; = (&lt;FONT color="#800080"&gt;ALL&lt;/FONT&gt;) &lt;FONT color="#0000FF"&gt;ALL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the basic form of a sudoers user specification.&lt;/P&gt;&lt;P&gt;It says that &lt;FONT color="#FF0000"&gt;root&lt;/FONT&gt; is allowed to use sudo &lt;FONT color="#99CC00"&gt;on all hosts using this sudoers file&lt;/FONT&gt;, to &lt;FONT color="#0000FF"&gt;run all possible commands&lt;/FONT&gt;, &lt;FONT color="#800080"&gt;as any user&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When a sudoers file is used on a single host, most sysadmins won't bother using the actual hostname in the hosts field; they will type "ALL" in the host field instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have a centrally managed sudoers file that is used on multiple hosts, you can use the hosts field to restrict some sudoers user specifications to a particular (set of) host(s) only.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Line 3:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;FONT color="#FF0000"&gt;ADMINS&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;ALL&lt;/FONT&gt; = NOPASSWD: &lt;FONT color="#0000FF"&gt;ALL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is another user specification, using the ADMINS user alias defined on line 1.&lt;/P&gt;&lt;P&gt;It also has the NOPASSWD tag, indicating that no password prompt will be presented before running the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The users listed by the ADMINS user alias may run &lt;FONT color="#0000FF"&gt;all commands&lt;/FONT&gt; as root (if the run-as field is omitted, the default value of &lt;FONT color="#800080"&gt;&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;root&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/FONT&gt; is assumed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, line 3 could is exactly equivalent to:&lt;/P&gt;&lt;PRE&gt;user1, user2 ALL = (root) NOPASSWD: ALL&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might want to write a comment like this as a syntax reminder to your sudoers file:&lt;/P&gt;&lt;PRE&gt;# &amp;lt;WHO does&amp;gt; &amp;lt;WHERE&amp;gt; = (&amp;lt;as WHO&amp;gt;) &amp;lt;WHAT&amp;gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2013 19:10:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudoers-file/m-p/6217175#M485392</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2013-09-25T19:10:19Z</dc:date>
    </item>
  </channel>
</rss>

