<?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: sudo file configuration in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745603#M481218</link>
    <description>&lt;P&gt;&amp;nbsp;When you do NOT specify sudo it is just running the 'su' command normally and thus will ask for the oracle password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to preface the command with 'sudo' otherwise the system does not know that it needs to use sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ sudo /usr/bin/su - oracle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jul 2012 13:25:49 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2012-07-30T13:25:49Z</dc:date>
    <item>
      <title>sudo file configuration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745247#M481214</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cmnd_Alias DB=/usr/bin/su - oracle&lt;BR /&gt;User_Alias DBA = testdba&lt;BR /&gt;DBA ALL = NOPASSWD: DB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I login as testdba and /usr/bin/su - oracle it asks for a password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i dont find amy mistake in this the above sudoers file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;grep testdba /etc/passwd&lt;BR /&gt;testdba:6x6S0BB2DST02:7546:765::/home/testdba:/sbin/sh&lt;/P&gt;&lt;P&gt;grep 765 /etc/group&lt;BR /&gt;DBA::765:&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2012 09:13:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745247#M481214</guid>
      <dc:creator>Madhuchakaravar</dc:creator>
      <dc:date>2012-07-30T09:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: sudo file configuration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745603#M481218</link>
      <description>&lt;P&gt;&amp;nbsp;When you do NOT specify sudo it is just running the 'su' command normally and thus will ask for the oracle password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to preface the command with 'sudo' otherwise the system does not know that it needs to use sudo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ sudo /usr/bin/su - oracle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2012 13:25:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745603#M481218</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2012-07-30T13:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: sudo file configuration</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745663#M481220</link>
      <description>&lt;P&gt;If you run "/usr/bin/su - oracle" as testdba, you are not using sudo at all, and the su command is asking for the password of the "oracle" user, as usual. You should be running "sudo /usr/bin/su - oracle" to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Login as testdba and run "sudo -l". Type the password if requested. The sudo command should list all the commands testdba is allowed to run. Does it say you're authorized to run the command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sudoers syntax has one error. You should specify which user the command should be allowed to run as.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without aliases:&lt;/P&gt;&lt;PRE&gt;testdba ALL = (root) NOPASSWD: /usr/bin/su - oracle&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;(This also highlights the fact that you're actually allowing testdba to run a single specific command as root. When used, this causes two messages to be logged: first, sudo will log that "testdba" is becoming "root" for the purpose of running "/usr/bin/su - oracle". Then su logs that "root" is becoming "oracle". This is more complex than necessary: sudo could do both steps on its own.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same with your aliases included:&lt;/P&gt;&lt;PRE&gt;Cmnd_Alias DB=/usr/bin/su - oracle
User_Alias DBA = testdba
DBA ALL = (root) NOPASSWD: DB&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A better configuration might be to "say what you mean". You want to allow testdba to do anything as user oracle. In sudoers syntax, that would be (without aliases):&lt;/P&gt;&lt;PRE&gt;testdba ALL = (oracle) NOPASSWD: ALL&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Or with aliases:&lt;/P&gt;&lt;PRE&gt;User_Alias DBA = testdba
Runas_Alias ORACLE = oracle
DBA ALL = (ORACLE) NOPASSWD: ALL&lt;/PRE&gt;&lt;P&gt;With this configuration, the testdba user will have to run "sudo -i -u oracle" to switch to the oracle user.&lt;/P&gt;&lt;P&gt;Now sudo will log this simply as "testdba is becoming oracle to run a shell".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This configuration will also allow testdba to run individual commands as the oracle user, e.g. if the testdba notices that the permissions of the tnsnames.ora are set too tight:&lt;/P&gt;&lt;PRE&gt;sudo -u oracle chmod a+r /opt/oracle/product/xx.x.x.x/network/admin/tnsnames.ora&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;When commands like this are used, sudo will create a single clear log entry, saying effectively: "user 'testdba' ran 'chmod a+r /opt/oracle/product/xx.x.x.x/network/admin/tnsnames.ora' as user 'oracle', successfully". If your system has strict logging requirements, this is the format the security auditors will want to see. There will be no ambiguity as to who did what using the "oracle" account.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2012 13:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-file-configuration/m-p/5745663#M481220</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2012-07-30T13:58:45Z</dc:date>
    </item>
  </channel>
</rss>

