<?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 question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785946#M264075</link>
    <description>Certainly it is possible to distribute so called command rsa key files which allow only the commands the distributor placed in them.&lt;BR /&gt; &lt;BR /&gt;Create a new rsa (or dsa) key pair&lt;BR /&gt; &lt;BR /&gt;$ ssh-keygen -t rsa -b 1024 -N "" -f ~/.ssh/id_rsa_cmd&lt;BR /&gt; &lt;BR /&gt;Edit the public key of the pair and place the commands you wish to be executed in the header.&lt;BR /&gt;   &lt;BR /&gt;$ vi ~/.ssh/id_rsa_cmd.pub&lt;BR /&gt;   &lt;BR /&gt;$ dd if=~/.ssh/id_rsa_cmd.pub bs=25 count=1 2&amp;gt;/dev/null;echo&lt;BR /&gt;command="hostname;uptime"&lt;BR /&gt; &lt;BR /&gt;Distribute the public key to a remote ssh host where you want this command to be run on connect.&lt;BR /&gt;  &lt;BR /&gt;$ ssh saz@gouda 'cat &amp;gt;&amp;gt;.ssh/authorized_keys' &amp;lt; ~/.ssh/id_rsa_cmd.pub&lt;BR /&gt; &lt;BR /&gt;Run a login with this key&lt;BR /&gt;  &lt;BR /&gt;$ ssh -i ~/.ssh/id_rsa_cmd  saz@gouda&lt;BR /&gt;gouda&lt;BR /&gt; 11:13am  up 104 days, 23:35,  1 user,  load average: 1.31, 1.47, 1.53&lt;BR /&gt;Connection to gouda closed.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;To abbreviate the invocation you could edit&lt;BR /&gt;~/.ssh/config&lt;BR /&gt;on the SSH client and add a &lt;BR /&gt;Host entry&lt;BR /&gt;with&lt;BR /&gt;IdentityFile  ~/.ssh/id_rsa_cmd&lt;BR /&gt; &lt;BR /&gt;Then you can omit the -i switch.&lt;BR /&gt;See "man ssh_config" for details.&lt;BR /&gt;</description>
    <pubDate>Thu, 11 May 2006 04:16:05 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2006-05-11T04:16:05Z</dc:date>
    <item>
      <title>ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785937#M264066</link>
      <description>I want to set up ssh to allow a user to remotely run a command but not to actually log on to a box - is there a way to do that?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 10 May 2006 10:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785937#M264066</guid>
      <dc:creator>Michael Murphy_2</dc:creator>
      <dc:date>2006-05-10T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785938#M264067</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You cab try using: rexec&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://linux.about.com/library/cmd/blcmdl1_rexec.htm" target="_blank"&gt;http://linux.about.com/library/cmd/blcmdl1_rexec.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 10 May 2006 11:13:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785938#M264067</guid>
      <dc:creator>Vipulinux</dc:creator>
      <dc:date>2006-05-10T11:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785939#M264068</link>
      <description>Hi Michael,&lt;BR /&gt;&lt;BR /&gt;you can use remsh command to run a commend line based task remotely.&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-90690/remsh.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-90690/remsh.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;here is an example of remote command via ssh.&lt;BR /&gt;&lt;A href="http://www.itc.virginia.edu/desktop/security/ssh.html" target="_blank"&gt;http://www.itc.virginia.edu/desktop/security/ssh.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sung</description>
      <pubDate>Wed, 10 May 2006 11:26:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785939#M264068</guid>
      <dc:creator>Sung Oh</dc:creator>
      <dc:date>2006-05-10T11:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785940#M264069</link>
      <description>More info:&lt;BR /&gt;&lt;BR /&gt;I want to be able to:&lt;BR /&gt;ssh &lt;HOST&gt; "command"&lt;BR /&gt;&lt;BR /&gt;but not&lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOST&gt;&lt;BR /&gt;&lt;BR /&gt;the latter being a login to the machine&lt;BR /&gt;&lt;BR /&gt;&lt;/HOST&gt;&lt;/HOST&gt;</description>
      <pubDate>Wed, 10 May 2006 11:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785940#M264069</guid>
      <dc:creator>Michael Murphy_2</dc:creator>
      <dc:date>2006-05-10T11:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785941#M264070</link>
      <description>Hi Michael,&lt;BR /&gt;&lt;BR /&gt;I don't think it's possible, because ssh, scp and sftp all uses the same port(22).&lt;BR /&gt;I quess you don't want to use rcp/remsh because of the security risks.&lt;BR /&gt;&lt;BR /&gt;Maybe you can check for a restricted shell, where you only allow scp, but don't know if it's possible.&lt;BR /&gt;&lt;BR /&gt;Darrel</description>
      <pubDate>Wed, 10 May 2006 11:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785941#M264070</guid>
      <dc:creator>Darrel Louis</dc:creator>
      <dc:date>2006-05-10T11:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785942#M264071</link>
      <description>Sorry to say, but no there isn't.  How ever you can achieve the same results through other means.  &lt;BR /&gt;&lt;BR /&gt;To use ssh as an equivalent to rexec or remsh you have to assign a working shell program like /usr/bin/sh to the user account.  But you can edit the .profile and add:&lt;BR /&gt;cleanupExit() # Declare an exit routine&lt;BR /&gt;{&lt;BR /&gt;        print "Bye!"&lt;BR /&gt;        sleep 1&lt;BR /&gt;        exit 0&lt;BR /&gt;}&lt;BR /&gt;print "Sorry! You may not login directly into this system!"&lt;BR /&gt;print "Press Return to Continue"&lt;BR /&gt;read&lt;BR /&gt;cleanupExit&lt;BR /&gt;&lt;BR /&gt;Put the cleanupExit at top of .profile and the rest at the bottom.  ssh will still work just fine as a remote shell command, but the user can not successfully login to the system.&lt;BR /&gt;&lt;BR /&gt;The only problem with this approach is if you have password aging enabled. At some point the user will have to approach you to reset their password, even if you use certificates.&lt;BR /&gt;</description>
      <pubDate>Wed, 10 May 2006 11:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785942#M264071</guid>
      <dc:creator>Ken Grabowski</dc:creator>
      <dc:date>2006-05-10T11:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785943#M264072</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've tested the following:&lt;BR /&gt;&lt;BR /&gt;- Added the following to my .profile&lt;BR /&gt; echo " No shell Login allowed"&lt;BR /&gt; exit&lt;BR /&gt;&lt;BR /&gt;I'm able to scp to the server and logged out when I try ssh &lt;HOSTNAME&gt;.&lt;BR /&gt;&lt;BR /&gt;You can also add "trap" codes to the .profile.&lt;BR /&gt;&lt;BR /&gt;Darrel&lt;/HOSTNAME&gt;</description>
      <pubDate>Wed, 10 May 2006 11:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785943#M264072</guid>
      <dc:creator>Darrel Louis</dc:creator>
      <dc:date>2006-05-10T11:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785944#M264073</link>
      <description>Yes you can do as have mentioned with ssh&lt;BR /&gt;&lt;BR /&gt;ssh hostname "command"&lt;BR /&gt;&lt;BR /&gt;Please refer&lt;BR /&gt;&lt;A href="http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1" target="_blank"&gt;http://unixhelp.ed.ac.uk/CGI/man-cgi?ssh+1&lt;/A&gt;&lt;BR /&gt;for some help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;ninad</description>
      <pubDate>Wed, 10 May 2006 11:44:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785944#M264073</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-05-10T11:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785945#M264074</link>
      <description>Try setting the user's shell to "/usr/bin/false" in the /etc/passwd file.</description>
      <pubDate>Wed, 10 May 2006 13:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785945#M264074</guid>
      <dc:creator>Josiah Henline</dc:creator>
      <dc:date>2006-05-10T13:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785946#M264075</link>
      <description>Certainly it is possible to distribute so called command rsa key files which allow only the commands the distributor placed in them.&lt;BR /&gt; &lt;BR /&gt;Create a new rsa (or dsa) key pair&lt;BR /&gt; &lt;BR /&gt;$ ssh-keygen -t rsa -b 1024 -N "" -f ~/.ssh/id_rsa_cmd&lt;BR /&gt; &lt;BR /&gt;Edit the public key of the pair and place the commands you wish to be executed in the header.&lt;BR /&gt;   &lt;BR /&gt;$ vi ~/.ssh/id_rsa_cmd.pub&lt;BR /&gt;   &lt;BR /&gt;$ dd if=~/.ssh/id_rsa_cmd.pub bs=25 count=1 2&amp;gt;/dev/null;echo&lt;BR /&gt;command="hostname;uptime"&lt;BR /&gt; &lt;BR /&gt;Distribute the public key to a remote ssh host where you want this command to be run on connect.&lt;BR /&gt;  &lt;BR /&gt;$ ssh saz@gouda 'cat &amp;gt;&amp;gt;.ssh/authorized_keys' &amp;lt; ~/.ssh/id_rsa_cmd.pub&lt;BR /&gt; &lt;BR /&gt;Run a login with this key&lt;BR /&gt;  &lt;BR /&gt;$ ssh -i ~/.ssh/id_rsa_cmd  saz@gouda&lt;BR /&gt;gouda&lt;BR /&gt; 11:13am  up 104 days, 23:35,  1 user,  load average: 1.31, 1.47, 1.53&lt;BR /&gt;Connection to gouda closed.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;To abbreviate the invocation you could edit&lt;BR /&gt;~/.ssh/config&lt;BR /&gt;on the SSH client and add a &lt;BR /&gt;Host entry&lt;BR /&gt;with&lt;BR /&gt;IdentityFile  ~/.ssh/id_rsa_cmd&lt;BR /&gt; &lt;BR /&gt;Then you can omit the -i switch.&lt;BR /&gt;See "man ssh_config" for details.&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2006 04:16:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785946#M264075</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-05-11T04:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: ssh question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785947#M264076</link>
      <description>Check the ssh forced commands feature:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/sshtdg/chapter/ch08.html" target="_blank"&gt;http://www.oreilly.com/catalog/sshtdg/chapter/ch08.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;//Michael</description>
      <pubDate>Thu, 11 May 2006 05:32:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ssh-question/m-p/3785947#M264076</guid>
      <dc:creator>Michael Kalisz</dc:creator>
      <dc:date>2006-05-11T05:32:46Z</dc:date>
    </item>
  </channel>
</rss>

