<?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: setuid script and remsh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396561#M200051</link>
    <description>Marc,&lt;BR /&gt;&lt;BR /&gt;  I believe this is the way how remsh works.&lt;BR /&gt;&lt;BR /&gt;  I was not able to get this working too.&lt;BR /&gt;&lt;BR /&gt;  Will the script code be changing often ? - If not, may be you can try this in C.&lt;BR /&gt;&lt;BR /&gt;  setuid() to user wsm.&lt;BR /&gt;&lt;BR /&gt;  and execute the script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  setuid(210);&lt;BR /&gt;  system("/usr/bin/remsh hulk -l wsm &amp;lt;script&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;- Sundar.&lt;/STDIO.H&gt;</description>
    <pubDate>Fri, 08 Oct 2004 12:47:52 GMT</pubDate>
    <dc:creator>Sundar_7</dc:creator>
    <dc:date>2004-10-08T12:47:52Z</dc:date>
    <item>
      <title>setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396559#M200049</link>
      <description>why isn't the following working&lt;BR /&gt;&lt;BR /&gt;ls -al frog&lt;BR /&gt;    -rwsr-xr-x   1 wsm        users          104 Oct  8 09:54 frog&lt;BR /&gt;cat frog&lt;BR /&gt;    #!/bin/sh&lt;BR /&gt;    echo id&lt;BR /&gt;    id&lt;BR /&gt;    echo who am i&lt;BR /&gt;    who am i&lt;BR /&gt;    echo whoami&lt;BR /&gt;    whoami&lt;BR /&gt;    remsh hulk -l wsm -n "uname -a"&lt;BR /&gt;./frog&lt;BR /&gt;    id&lt;BR /&gt;    uid=206(mahrendt) gid=200(dba) euid=210(wsm) groups=121(sysadmA),201(docctrl)&lt;BR /&gt;    who am i&lt;BR /&gt;    mahrendt   ttyrc        Oct  8 09:52&lt;BR /&gt;    whoami&lt;BR /&gt;    wsm&lt;BR /&gt;    remshd: Login incorrect&lt;BR /&gt;NOTE: the .rhosts file for wsm on hulk has the following entry&lt;BR /&gt;    + wsm&lt;BR /&gt;&lt;BR /&gt;my goal is to have everyone be able to run frog ...allowing them to access hulk as wsm to run a script on hulk as wsm (just using uname as an example above)&lt;BR /&gt;&lt;BR /&gt;why isn't SETUID working? is remsh not fooled by SETUID? i really would like to use SETUID. &lt;BR /&gt;</description>
      <pubDate>Fri, 08 Oct 2004 12:08:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396559#M200049</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2004-10-08T12:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396560#M200050</link>
      <description>what is there in /etc/hosts.equiv file in remote host of hlk there. Are you have same entries as,&lt;BR /&gt;&lt;BR /&gt; localhost&lt;BR /&gt; &lt;BR /&gt; $wsmhomedirectory/.rhosts&lt;BR /&gt; + hulk&lt;BR /&gt;&lt;BR /&gt; Check the permission of files there too.</description>
      <pubDate>Fri, 08 Oct 2004 12:34:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396560#M200050</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-10-08T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396561#M200051</link>
      <description>Marc,&lt;BR /&gt;&lt;BR /&gt;  I believe this is the way how remsh works.&lt;BR /&gt;&lt;BR /&gt;  I was not able to get this working too.&lt;BR /&gt;&lt;BR /&gt;  Will the script code be changing often ? - If not, may be you can try this in C.&lt;BR /&gt;&lt;BR /&gt;  setuid() to user wsm.&lt;BR /&gt;&lt;BR /&gt;  and execute the script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  setuid(210);&lt;BR /&gt;  system("/usr/bin/remsh hulk -l wsm &amp;lt;script&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;- Sundar.&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 08 Oct 2004 12:47:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396561#M200051</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-08T12:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396562#M200052</link>
      <description>Muthukumar ...thx, but /etc/hosts.equiv is superseded by .rhosts settings and .rhosts for user wsm on hulk is setup correctly&lt;BR /&gt;&lt;BR /&gt;Sundar ...thx, i actually got it to work by doing what you said (i copied your C code and actually made the binary owned by root with permissions 4555)&lt;BR /&gt;&lt;BR /&gt;my final question is how can i pass command line arguments to the C program so that it in turn passes them to the remsh command ...basically the script on the remote machine takes several arguements like the following&lt;BR /&gt;&lt;BR /&gt;script "arg 1" arg2 "agr thr ee" ...need to preserve the quotes since some arguements have spaces</description>
      <pubDate>Fri, 08 Oct 2004 13:54:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396562#M200052</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2004-10-08T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396563#M200053</link>
      <description>As a user wsm log onto hulk. (user plain/old telnet) Once you login, do a who -um.&lt;BR /&gt;&lt;BR /&gt;What appears in the last column??? The same ip address/hostname needs to be put in $HOME/.rhosts file of wsm user on hulk.&lt;BR /&gt;&lt;BR /&gt;Should somthing like as follows. also check the perms on .rhosts file. Should read for owner.&lt;BR /&gt;&lt;BR /&gt;ip_address/hostname wsm&lt;BR /&gt;&lt;BR /&gt;Try this and post.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 08 Oct 2004 14:03:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396563#M200053</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-08T14:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396564#M200054</link>
      <description>In order for remsh to work. .rhosts MUST be 600 permission and both computers must be able to resolve each other both by name and by IP using nslookup. Your DNS server may be missing reverse lookup records.</description>
      <pubDate>Fri, 08 Oct 2004 15:19:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396564#M200054</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-10-08T15:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396565#M200055</link>
      <description>RAC &amp;amp; Bill ...thx, but it is not a .rhosts or a hostname resolution problem (i got a handle on those issues). Sundar was able to reproduce my situation ...seems that remsh is not fooled by the SETUID bit&lt;BR /&gt;&lt;BR /&gt;however, if i use Sundar's C code it works&lt;BR /&gt;&lt;BR /&gt;vi frogC.c (add his code)&lt;BR /&gt;cc -o frogC frogC.c&lt;BR /&gt;chown root frogC&lt;BR /&gt;chmod 4555 frogC&lt;BR /&gt;now when people run frogC the system treats them as being "wsm" and so the remsh works to the remote system hulk&lt;BR /&gt;&lt;BR /&gt;i haven't used C in a long time and only now just need to know how to pass command line arguments in C to the remsh command in frogC</description>
      <pubDate>Fri, 08 Oct 2004 16:50:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396565#M200055</guid>
      <dc:creator>Marc Ahrendt</dc:creator>
      <dc:date>2004-10-08T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396566#M200056</link>
      <description>Did you try the solution I gave?? I do think that this is host resolution/wrong set up of .rhosts file.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 08 Oct 2004 16:57:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396566#M200056</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-08T16:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396567#M200057</link>
      <description>Anil et all,&lt;BR /&gt;&lt;BR /&gt;  If .rhosts is the issue, when remsh is executed from C excerpt, it wont work either.&lt;BR /&gt; &lt;BR /&gt;  So, believe me, it is not an issue with .rhosts file :-)&lt;BR /&gt;&lt;BR /&gt;  I may not be able to explain why remsh is not taking the setuid bit, but I was able to reproduce the problem.&lt;BR /&gt;&lt;BR /&gt;  Marc: I am not good at C. I can show you how to pass command line arguments. &lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STRINGS.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;main(int argc,char **argv)&lt;BR /&gt;{&lt;BR /&gt;  int i;&lt;BR /&gt;  char *parms;&lt;BR /&gt;  for(i=1;i&amp;lt;=argc;i++)&lt;BR /&gt;  {&lt;BR /&gt;   strcat(parms,argv[i]);&lt;BR /&gt;   strcat(parms," ");&lt;BR /&gt;  }&lt;BR /&gt;  setuid(45906);&lt;BR /&gt;  execl("/usr/bin/sh", "sh", "-c", "remsh hulk -l wsm &amp;lt;script&amp;gt;",parms,0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The above program is core dumping for whatever reasons - I am sure you can take it from there :-)&lt;BR /&gt;&lt;BR /&gt;- Sundar&lt;/STDLIB.H&gt;&lt;/STRINGS.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 08 Oct 2004 17:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396567#M200057</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-10-08T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396568#M200058</link>
      <description>Sundar,&lt;BR /&gt;&lt;BR /&gt;I am also not very good at c/c++. I read the posting again. I still believe, he need to prepare the .rhosts fil on hulk as follows.&lt;BR /&gt;&lt;BR /&gt;With perms 600.&lt;BR /&gt;&lt;BR /&gt;"ip_address_of_the machine_he_is_executing_the_script_on" wsm&lt;BR /&gt;&lt;BR /&gt;I do not have machine at hand the moment to try this out.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 08 Oct 2004 17:35:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396568#M200058</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-10-08T17:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396569#M200059</link>
      <description>My understanding is that HPUX SETUID on a script, but will execute a SETUID binary.</description>
      <pubDate>Mon, 11 Oct 2004 06:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396569#M200059</guid>
      <dc:creator>Gary L. Paveza, Jr.</dc:creator>
      <dc:date>2004-10-11T06:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396570#M200060</link>
      <description>NO points please.  The above should read HPUX ignores SETUID on a script, but executes it on a binary.</description>
      <pubDate>Tue, 12 Oct 2004 06:33:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396570#M200060</guid>
      <dc:creator>Gary L. Paveza, Jr.</dc:creator>
      <dc:date>2004-10-12T06:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396571#M200061</link>
      <description>Hi, folks!&lt;BR /&gt;&lt;BR /&gt;Just my two cents... :-)&lt;BR /&gt;The "SETUID" for scripts traditionally works on HP-UX if the interpreter is specified (#!/usr/bin/sh e.g.).&lt;BR /&gt; &lt;BR /&gt;However, beginning with 11.22 there is a kernel tunable secure_sid_scripts to disable this feature.&lt;BR /&gt; &lt;BR /&gt;But this is not the point here. Inside a suid script only your effective user id (euid) gets changed, but not your real user id which is used by remsh. To change also the ruid you need to use setresuid(2).&lt;BR /&gt; &lt;BR /&gt;I attached a sample C wrapper which should help (and passes arguments also).&lt;BR /&gt; &lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.</description>
      <pubDate>Tue, 12 Oct 2004 07:35:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396571#M200061</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-10-12T07:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: setuid script and remsh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396572#M200062</link>
      <description>Oops, attached the wrong file. Pls use this one.</description>
      <pubDate>Tue, 12 Oct 2004 08:12:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setuid-script-and-remsh/m-p/3396572#M200062</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-10-12T08:12:34Z</dc:date>
    </item>
  </channel>
</rss>

