<?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 on HP-UX in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233531#M468736</link>
    <description>Probably I need to explain myself in a better way.&lt;BR /&gt;&lt;BR /&gt;I have configured sudo to either run on the command su - or sudo su - because some aplication have inbuilt su - so you dont have to put your password the second time.&lt;BR /&gt;&lt;BR /&gt;On the Linux box which works perfectly ok. This are my logon details&lt;BR /&gt;-bash-3.00$ su -&lt;BR /&gt;[root@gbahevl181 ~]#&lt;BR /&gt;[root@gbahevl181 ~]# su - h070ahe&lt;BR /&gt;-sh-3.00$ pwd&lt;BR /&gt;/home/h070ahe&lt;BR /&gt;&lt;BR /&gt;[root@gbahevl181 ~]# which sudo&lt;BR /&gt;/usr/bin/sudo&lt;BR /&gt;[root@gbahevl181 ~]# cd /bin&lt;BR /&gt;[root@gbahevl181 bin]# ls -l su*&lt;BR /&gt;-rwsr-sr-x  1 root root    22 Mar 23 15:26 su&lt;BR /&gt;-rwsr-xr-x  1 root root 60820 Oct  4  2006 su.original&lt;BR /&gt;[root@gbahevl181 bin]# cat su&lt;BR /&gt;sudo su.original "$@"&lt;BR /&gt;&lt;BR /&gt;On the HP-UX box:&lt;BR /&gt;$ pwd&lt;BR /&gt;/home/D060AHE&lt;BR /&gt;$ su -&lt;BR /&gt;gbaheu65:/ #&lt;BR /&gt;gbaheu65:/ # which sudo&lt;BR /&gt;/usr/local/bin/sudo&lt;BR /&gt;gbaheu65:/ # whence su&lt;BR /&gt;/usr/bin/su&lt;BR /&gt;&lt;BR /&gt;gbaheu65:/ # cd /bin&lt;BR /&gt;gbaheu65:/bin # ls -l su*&lt;BR /&gt;-rwsrwsrwx   1 root       sys             25 Mar 31 09:10 su&lt;BR /&gt;-r-sr-xr-x   1 root       bin          28672 Mar  8  2006 su.original&lt;BR /&gt;gbaheu65:/bin # cat su&lt;BR /&gt;sudo su.original "$@"&lt;BR /&gt;&lt;BR /&gt;gbaheu65:/ # su - H070AHE&lt;BR /&gt;You are already root, you don't need to use sudo.</description>
    <pubDate>Wed, 07 Apr 2010 06:07:26 GMT</pubDate>
    <dc:creator>oza</dc:creator>
    <dc:date>2010-04-07T06:07:26Z</dc:date>
    <item>
      <title>Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233527#M468732</link>
      <description>I have alredy configured sudo on my HP-UX system, which works ok but whenever I tried to switch to another user I received the following error:&lt;BR /&gt;&lt;BR /&gt;$ sudo su -&lt;BR /&gt;gbaheq08:/ #&lt;BR /&gt;gbaheq08:/ # su - sched&lt;BR /&gt;You are already root, you don't need to use sudo.&lt;BR /&gt;&lt;BR /&gt;This works perfectly well with my Linux, but unable to do the same with HP-UX. Any help will be appreciated.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2010 13:12:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233527#M468732</guid>
      <dc:creator>oza</dc:creator>
      <dc:date>2010-04-06T13:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233528#M468733</link>
      <description>Welcome to ITRC Forums!&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ sudo su -&lt;BR /&gt;&lt;BR /&gt;This causes sudo to switch you to root, then runs "su -" to switch you from root to root, re-creating the environment settings. This seems like a tautology. If clarity of security logs is important, and your version of sudo is new enough, a simple "sudo -i" will give you a login-like root session. But I digress...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; gbaheq08:/ # su - sched&lt;BR /&gt;&amp;gt; You are already root, you don't need to use sudo.&lt;BR /&gt;&lt;BR /&gt;You're probably not using the standard /usr/bin/su, but instead some local script that is designed to promote the use of sudo instead of su. &lt;BR /&gt;&lt;BR /&gt;Run "whence su" to find the command that actually gets executed. &lt;BR /&gt;Then "file $(whence su)" to see whether it's a binary or a script.&lt;BR /&gt;&lt;BR /&gt;And if applicable, talk with any other and/or previous HP-UX sysadmins at your site. Your site might have some configuration policies you would need to know. If the system was installed from an Ignite server or a Golden Image, some site-specific customizations may have been included to the installation sources.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Tue, 06 Apr 2010 13:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233528#M468733</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-04-06T13:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233529#M468734</link>
      <description>What are the sudo versions in your Linux and HP-UX servers?&lt;BR /&gt;&lt;BR /&gt;Based on the sudo.c code &lt;A href="http://www.opensource.apple.com/source/sudo/sudo-10/sudo/sudo.c" target="_blank"&gt;http://www.opensource.apple.com/source/sudo/sudo-10/sudo/sudo.c&lt;/A&gt; root is not allowed to run sudo. The first command "sudo su - " does not exit so technically the "su - sched" is run by sudo and sudo does not allow root to run it.&lt;BR /&gt;&lt;BR /&gt;Are you saying that the exact same commands run differently in Linux? That's why I am asking to check your sudo versions. Unless the "su -" behaves differently in Linux than in hp-ux.</description>
      <pubDate>Tue, 06 Apr 2010 13:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233529#M468734</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2010-04-06T13:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233530#M468735</link>
      <description>&amp;gt; Based on the sudo.c code &lt;A href="http://www.opensource.apple.com/source/sudo/sudo-10/sudo/sudo.c" target="_blank"&gt;http://www.opensource.apple.com/source/sudo/sudo-10/sudo/sudo.c&lt;/A&gt; root is not allowed to run sudo.&lt;BR /&gt;&lt;BR /&gt;It is configurable.&lt;BR /&gt;&lt;BR /&gt;Whether root can run sudo or not depends on the state of the code flag I_ROOT_SUDO, which is controlled by the configuration flag "root_sudo" in the sudoers file. In most sudo packages distributed for HP-UX, the use of sudo by root is enabled by default.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The first command "sudo su - " does not exit so technically the "su - sched" is run by sudo and sudo does not allow root to run it.&lt;BR /&gt;&lt;BR /&gt;More accurately, the first "sudo" in "sudo su -" is running "su -", which is running root's shell (in HP-UX, that's /sbin/sh), and *that shell* is running the command "su - sched" which should run su, not sudo. &lt;BR /&gt;&lt;BR /&gt;But the error message reveals it apparently somehow ends up running sudo again, perhaps because of some local customization we cannot see.&lt;BR /&gt;&lt;BR /&gt;The first "sudo" does not exit, that's true. But "sudo" by itself does not display any prompts: it needs a shell for that.&lt;BR /&gt;&lt;BR /&gt;If you don't believe me, run this command:&lt;BR /&gt;UNIX95=1 ps -Hef&lt;BR /&gt;&lt;BR /&gt;Then find the sudo session and look at the hierarchy of processes.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Wed, 07 Apr 2010 05:38:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233530#M468735</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-04-07T05:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233531#M468736</link>
      <description>Probably I need to explain myself in a better way.&lt;BR /&gt;&lt;BR /&gt;I have configured sudo to either run on the command su - or sudo su - because some aplication have inbuilt su - so you dont have to put your password the second time.&lt;BR /&gt;&lt;BR /&gt;On the Linux box which works perfectly ok. This are my logon details&lt;BR /&gt;-bash-3.00$ su -&lt;BR /&gt;[root@gbahevl181 ~]#&lt;BR /&gt;[root@gbahevl181 ~]# su - h070ahe&lt;BR /&gt;-sh-3.00$ pwd&lt;BR /&gt;/home/h070ahe&lt;BR /&gt;&lt;BR /&gt;[root@gbahevl181 ~]# which sudo&lt;BR /&gt;/usr/bin/sudo&lt;BR /&gt;[root@gbahevl181 ~]# cd /bin&lt;BR /&gt;[root@gbahevl181 bin]# ls -l su*&lt;BR /&gt;-rwsr-sr-x  1 root root    22 Mar 23 15:26 su&lt;BR /&gt;-rwsr-xr-x  1 root root 60820 Oct  4  2006 su.original&lt;BR /&gt;[root@gbahevl181 bin]# cat su&lt;BR /&gt;sudo su.original "$@"&lt;BR /&gt;&lt;BR /&gt;On the HP-UX box:&lt;BR /&gt;$ pwd&lt;BR /&gt;/home/D060AHE&lt;BR /&gt;$ su -&lt;BR /&gt;gbaheu65:/ #&lt;BR /&gt;gbaheu65:/ # which sudo&lt;BR /&gt;/usr/local/bin/sudo&lt;BR /&gt;gbaheu65:/ # whence su&lt;BR /&gt;/usr/bin/su&lt;BR /&gt;&lt;BR /&gt;gbaheu65:/ # cd /bin&lt;BR /&gt;gbaheu65:/bin # ls -l su*&lt;BR /&gt;-rwsrwsrwx   1 root       sys             25 Mar 31 09:10 su&lt;BR /&gt;-r-sr-xr-x   1 root       bin          28672 Mar  8  2006 su.original&lt;BR /&gt;gbaheu65:/bin # cat su&lt;BR /&gt;sudo su.original "$@"&lt;BR /&gt;&lt;BR /&gt;gbaheu65:/ # su - H070AHE&lt;BR /&gt;You are already root, you don't need to use sudo.</description>
      <pubDate>Wed, 07 Apr 2010 06:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233531#M468736</guid>
      <dc:creator>oza</dc:creator>
      <dc:date>2010-04-07T06:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233532#M468737</link>
      <description>So when you enter the command:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; gbaheu65:/ # su - H070AHE&lt;BR /&gt;&lt;BR /&gt;The actual command that gets executed will be:&lt;BR /&gt;&lt;BR /&gt;sudo /usr/bin/su.original - H070AHE&lt;BR /&gt;&lt;BR /&gt;So, the problem is in the sudoers file.&lt;BR /&gt;&lt;BR /&gt;Either your HP-UX sudoers file contains a line like:&lt;BR /&gt;&lt;BR /&gt;Defaults !root_sudo&lt;BR /&gt;&lt;BR /&gt;or your HP-UX sudo has been set up to not allow root to use sudo as a compile-time default. (If that's the case, override the default by adding "Defaults root_sudo" to your sudoers file.)&lt;BR /&gt;&lt;BR /&gt;In Linux, sudo apparently uses developer's "factory defaults", and root_sudo is enabled by default.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Wed, 07 Apr 2010 06:58:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233532#M468737</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-04-07T06:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233533#M468738</link>
      <description>Hi Matti,&lt;BR /&gt;Thanks. I added "Defaults root_sudo" to the /etc/sudoers file and it works perfectly. Have a nice day.</description>
      <pubDate>Wed, 07 Apr 2010 07:44:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233533#M468738</guid>
      <dc:creator>oza</dc:creator>
      <dc:date>2010-04-07T07:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233534#M468739</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Please find the link below&lt;BR /&gt;&lt;A href="http://www.gratisoft.us/sudo/man/sudo.html" target="_blank"&gt;http://www.gratisoft.us/sudo/man/sudo.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers//&lt;BR /&gt;Taifur&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Apr 2010 10:13:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233534#M468739</guid>
      <dc:creator>Taifur</dc:creator>
      <dc:date>2010-04-07T10:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sudo on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233535#M468740</link>
      <description>I editted the /etc/sudoers file to include:&lt;BR /&gt;&lt;BR /&gt;Defaults root_sudo</description>
      <pubDate>Mon, 17 May 2010 13:57:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sudo-on-hp-ux/m-p/5233535#M468740</guid>
      <dc:creator>oza</dc:creator>
      <dc:date>2010-05-17T13:57:37Z</dc:date>
    </item>
  </channel>
</rss>

