<?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 Help on sudoers and Runas_Alias in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745130#M43455</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thank you for your time. Request you to help with the sudoers issue I am facing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am trying to make use of Runas_Alias feature of sudoers. Some how I am not able to. Hope someone can help me. Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;I want the script /app2/run to be run as user "operator" when executed by the user engg. The /app2/run is just a sample script with "id" command in it for testing purpose. Anyways, here is the contents&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ cat run&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;echo "-----------------------------------------------"&lt;BR /&gt;id&lt;BR /&gt;echo "-----------------------------------------------"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In /etc/sudoers, I have the following entry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;Runas_Alias OP=operator&lt;BR /&gt;engg         ALL =  (OP) NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I executed it using the -u option but no luck. I also tried giving the uid instead of username.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ sudo -u operator ./run&lt;BR /&gt;sudo: unable to execute /app2/run: Permission denied&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there anything I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Here is my unix box version&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ uname -a&lt;BR /&gt;Linux flx1208 2.6.21_mvlcge510-pc_target-x86_em64t-Malban10-cge5 #1 SMP PREEMPT RT Thu Nov 18 07:12:50 CST 2010 x86_64 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Normal sudoers works, I mean if I have entry like&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;engg         ALL =  NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And on execution&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ sudo ./run&lt;BR /&gt;-----------------------------------------------&lt;BR /&gt;uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),4(adm)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank You,&lt;BR /&gt;Ahamed</description>
    <pubDate>Fri, 28 Jan 2011 00:49:11 GMT</pubDate>
    <dc:creator>ahamed.en</dc:creator>
    <dc:date>2011-01-28T00:49:11Z</dc:date>
    <item>
      <title>Help on sudoers and Runas_Alias</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745130#M43455</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thank you for your time. Request you to help with the sudoers issue I am facing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am trying to make use of Runas_Alias feature of sudoers. Some how I am not able to. Hope someone can help me. Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;I want the script /app2/run to be run as user "operator" when executed by the user engg. The /app2/run is just a sample script with "id" command in it for testing purpose. Anyways, here is the contents&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ cat run&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;echo "-----------------------------------------------"&lt;BR /&gt;id&lt;BR /&gt;echo "-----------------------------------------------"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In /etc/sudoers, I have the following entry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;Runas_Alias OP=operator&lt;BR /&gt;engg         ALL =  (OP) NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I executed it using the -u option but no luck. I also tried giving the uid instead of username.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ sudo -u operator ./run&lt;BR /&gt;sudo: unable to execute /app2/run: Permission denied&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there anything I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;Here is my unix box version&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ uname -a&lt;BR /&gt;Linux flx1208 2.6.21_mvlcge510-pc_target-x86_em64t-Malban10-cge5 #1 SMP PREEMPT RT Thu Nov 18 07:12:50 CST 2010 x86_64 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Normal sudoers works, I mean if I have entry like&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;engg         ALL =  NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And on execution&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;$ sudo ./run&lt;BR /&gt;-----------------------------------------------&lt;BR /&gt;uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),4(adm)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank You,&lt;BR /&gt;Ahamed</description>
      <pubDate>Fri, 28 Jan 2011 00:49:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745130#M43455</guid>
      <dc:creator>ahamed.en</dc:creator>
      <dc:date>2011-01-28T00:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help on sudoers and Runas_Alias</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745131#M43456</link>
      <description>Hi,&lt;BR /&gt;$ sudo -u operator ./run&lt;BR /&gt;sudo: unable to execute /app2/run: Permission denied&lt;BR /&gt;&lt;BR /&gt;This means operator user has no right to execute /app2/run file. Can you check the permissions of  /app2/run?&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Fri, 28 Jan 2011 06:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745131#M43456</guid>
      <dc:creator>Turgay Cavdar</dc:creator>
      <dc:date>2011-01-28T06:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help on sudoers and Runas_Alias</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745132#M43457</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Initially I didn't give permission for executing the script /app2/run for neither of the users - operator and engg. &lt;BR /&gt;&lt;BR /&gt;I thought the below line in /etc/sudoers would give the permission for the user operator to execute the script&lt;BR /&gt;&lt;BR /&gt;operatorALL = NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;And this line would give the permission for the user engg to execute and associating the Runas_Alias will make it execute as the user operator&lt;BR /&gt;&lt;BR /&gt;Runas_Alias OP=operator&lt;BR /&gt;engg ALL =  (OP) NOPASSWD: /app2/run&lt;BR /&gt;&lt;BR /&gt;But I guess I was wrong. Now when I gave the permission for the user operator to execute /app2/run, su -u operator /app2/run is successful when execute from engg user login.&lt;BR /&gt;&lt;BR /&gt;I hope now my understanding is correct or if there is any different concept altogether?&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for the crucial clue :)&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Ahamed.</description>
      <pubDate>Fri, 28 Jan 2011 10:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-on-sudoers-and-runas-alias/m-p/4745132#M43457</guid>
      <dc:creator>ahamed.en</dc:creator>
      <dc:date>2011-01-28T10:21:10Z</dc:date>
    </item>
  </channel>
</rss>

