<?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: ssh using su and a different shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260894#M659564</link>
    <description>Yep, I ran what Todd suggests, and it works fine.</description>
    <pubDate>Fri, 29 Oct 2010 13:50:14 GMT</pubDate>
    <dc:creator>TwoProc</dc:creator>
    <dc:date>2010-10-29T13:50:14Z</dc:date>
    <item>
      <title>ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260892#M659562</link>
      <description>Easy high points here...&lt;BR /&gt;&lt;BR /&gt;Im attempting to ssh to another box (as root), su as another user and change shell to run a "for loop".&lt;BR /&gt;so...&lt;BR /&gt;&lt;BR /&gt;it should look like :&lt;BR /&gt;&lt;BR /&gt;ssh -t hpbox su - auser -c "sh for i in 1\;do echo \$i\;done"&lt;BR /&gt;&lt;BR /&gt;Yes (in advance) I know that one method would be to add the shell to auser another would be to create a script and run that etc.&lt;BR /&gt;Im really interested in this method.&lt;BR /&gt;&lt;BR /&gt;ssh -t hpbox su - auser -c 'ls' -&amp;gt; works&lt;BR /&gt;ssh -t hpbox su - auser -c 'sh ls' -&amp;gt; this logs me into the shell without running ls...&lt;BR /&gt;&lt;BR /&gt;All help appreciated and rewarded - thks in advance. I have looked at the related threads but they dont address all 3 things - cheers</description>
      <pubDate>Fri, 29 Oct 2010 09:44:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260892#M659562</guid>
      <dc:creator>eric lipede_1</dc:creator>
      <dc:date>2010-10-29T09:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260893#M659563</link>
      <description>&lt;!--!*#--&gt;Your missing another -c.&lt;BR /&gt;&lt;BR /&gt;ssh -t hpbox su - auser -c 'sh -c ls' &lt;BR /&gt;&lt;BR /&gt;should work.  A shell other then sh might be different.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Oct 2010 13:26:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260893#M659563</guid>
      <dc:creator>Todd D Kirkham</dc:creator>
      <dc:date>2010-10-29T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260894#M659564</link>
      <description>Yep, I ran what Todd suggests, and it works fine.</description>
      <pubDate>Fri, 29 Oct 2010 13:50:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260894#M659564</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2010-10-29T13:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260895#M659565</link>
      <description>Please try:&lt;BR /&gt;&lt;BR /&gt;ssh -t hpbox su - auser -c 'sh -c ls'&lt;BR /&gt;&lt;BR /&gt;Maintaining proper quoting through all the different command line parsing layers will be a bit of a challenge:&lt;BR /&gt;&lt;BR /&gt;- local shell parses the command line once (removing the outermost set of quotes, and un-escaping backslash-escaped characters) before passing it to the ssh command&lt;BR /&gt;&lt;BR /&gt;- root@hpbox's shell parses the su command line again (removing another set of quotes and possibly acting on special characters un-escaped in the previous step) before passing it to the su command&lt;BR /&gt;&lt;BR /&gt;- auser@hpbox's "sh -c" should receive the payload part of the command line as one argument&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Fri, 29 Oct 2010 13:53:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260895#M659565</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-10-29T13:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260896#M659566</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;There's a definite limit to the amount of complexity you can have on a ssh remote command.  Heck, even awk or perl one-liners can get a bit entertaining with quoting, escaping $ signs etc.&lt;BR /&gt;&lt;BR /&gt;Any type of looping, in my opinion, definitely falls into the 'easier to do other ways' category.  &lt;BR /&gt;&lt;BR /&gt;If this is for an operational requirement, I'd look into those, if I were you.  (even generating the script file on the fly and scp'ing it over...).  &lt;BR /&gt;&lt;BR /&gt;If this is just a mental exercise: good luck!&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Fri, 29 Oct 2010 14:31:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260896#M659566</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2010-10-29T14:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260897#M659567</link>
      <description>&lt;!--!*#--&gt;Hi Eric,&lt;BR /&gt;&lt;BR /&gt;Maybe the following is also an option for you, by running the for loop on the local server the escaping would be much less complicated:&lt;BR /&gt;&lt;BR /&gt;for i in 1;&lt;BR /&gt;  do&lt;BR /&gt;    ssh -t hpbox su - auser -c 'sh -c echo '$i;&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Viktor</description>
      <pubDate>Sat, 30 Oct 2010 12:43:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260897#M659567</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2010-10-30T12:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260898#M659568</link>
      <description>Viktor - thks but like i said the solution must be run from another node.  O fcourse running it on the remote node would be great and we wouldnt be here otherwise ! -thks and points-ish assigned for your effort.</description>
      <pubDate>Sat, 30 Oct 2010 13:01:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260898#M659568</guid>
      <dc:creator>eric lipede_1</dc:creator>
      <dc:date>2010-10-30T13:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: ssh using su and a different shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260899#M659569</link>
      <description>thks</description>
      <pubDate>Sun, 31 Oct 2010 04:47:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-using-su-and-a-different-shell/m-p/5260899#M659569</guid>
      <dc:creator>eric lipede_1</dc:creator>
      <dc:date>2010-10-31T04:47:23Z</dc:date>
    </item>
  </channel>
</rss>

