<?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 command within script gives &amp;quot;select: Invalid argument&amp;quot; error. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616834#M104563</link>
    <description>doh.&lt;BR /&gt;&lt;BR /&gt;go back to your original script... do what doug said. :)&lt;BR /&gt;&lt;BR /&gt;this: ssh -l root hostname&lt;BR /&gt;&lt;BR /&gt;to this: ssh -i /path/to/your__passwordless_key -l root hostname&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if all else fails, also use the "-vvv" w/the above ssh syntax change to see what's happening.&lt;BR /&gt;</description>
    <pubDate>Thu, 01 Sep 2005 09:19:07 GMT</pubDate>
    <dc:creator>Denver Osborn</dc:creator>
    <dc:date>2005-09-01T09:19:07Z</dc:date>
    <item>
      <title>ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616825#M104554</link>
      <description>Good Morning,&lt;BR /&gt;&lt;BR /&gt;I have written a script to keep a dmz'd ftp server synced with one behind a firewall.  The script runs fine via command line but has problems with one of the commands when run from cron.  The script runs on a sco box using rsync and ssh to connect to an hpux 11.11 system.  Here is the command that fails:&lt;BR /&gt;&lt;BR /&gt;if [ `ssh -l root hostname ls /$path/$to/$list | wc -l` -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;rsync ....&lt;BR /&gt;&lt;BR /&gt;debugging info returns the following&lt;BR /&gt;select: Invalid argument&lt;BR /&gt;+ [ 0 -gt 0 ]&lt;BR /&gt;&lt;BR /&gt;I've set PATH as well as sourcing /etc/profile and /root/.profile within the script.  No luck.  Scripting is not my forte.  I would greatly appreciate any insight!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Eric</description>
      <pubDate>Thu, 01 Sep 2005 08:22:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616825#M104554</guid>
      <dc:creator>erics_1</dc:creator>
      <dc:date>2005-09-01T08:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616826#M104555</link>
      <description>Hey Eric,&lt;BR /&gt;&lt;BR /&gt;can you attach the script being kicked off via cron?&lt;BR /&gt;&lt;BR /&gt;Have you also looked at getting some debug output from ssh to see that ssh isn't the problem...&lt;BR /&gt;&lt;BR /&gt;-denver</description>
      <pubDate>Thu, 01 Sep 2005 08:28:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616826#M104555</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2005-09-01T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616827#M104556</link>
      <description>Eric, &lt;BR /&gt;&lt;BR /&gt;Probably a path error from cron for the "ssh" command.  Try using the full path to ssh.&lt;BR /&gt;&lt;BR /&gt;Also, I generally surround the command string in an ssh command with "quotes" and have more sucess with that.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Sep 2005 08:32:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616827#M104556</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-09-01T08:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616828#M104557</link>
      <description>Which version of ssh are you running?&lt;BR /&gt;This is a known "feature" of earlier implementations of ssh, and usually the command is exected correctly (which is why ssh returns zero) so it's an irritant rather than a problem. &lt;BR /&gt;</description>
      <pubDate>Thu, 01 Sep 2005 08:46:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616828#M104557</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-09-01T08:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616829#M104558</link>
      <description>doh, noticed back tics...&lt;BR /&gt;&lt;BR /&gt;instead of:&lt;BR /&gt;if [ `ssh -l root hostname ls /$path/$to/$list | wc -l` -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;rsync...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;how about...&lt;BR /&gt;&lt;BR /&gt;if [ "$(ssh -l root hostname 'ls /path |wc -l' 2&amp;gt;/dev/null)" -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;rsync...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;-denver</description>
      <pubDate>Thu, 01 Sep 2005 08:53:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616829#M104558</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2005-09-01T08:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616830#M104559</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Silly question of the week:  When running from the command line, does your ssh ask for a password/phrase and/or is it using a ssh agent?&lt;BR /&gt;&lt;BR /&gt;If so, you'll need to set up a null passphrased alternate identity, then change the ssh command to:&lt;BR /&gt;&lt;BR /&gt;ssh -i ${alt_id} -l root ...&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Thu, 01 Sep 2005 09:03:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616830#M104559</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2005-09-01T09:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616831#M104560</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;Thanks for the input thus far.  ssh version is 3.0.2 on SCO.  Attached is a modified script to protect the innocent.  I'm trying Denver's suggestion now.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Eric</description>
      <pubDate>Thu, 01 Sep 2005 09:03:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616831#M104560</guid>
      <dc:creator>erics_1</dc:creator>
      <dc:date>2005-09-01T09:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616832#M104561</link>
      <description>Doug,&lt;BR /&gt;&lt;BR /&gt;I have public keys setup to allow ssh and rsync across without password/phrase.  Denver, I tried your syntax but it looks like the script is just hanging there.  I do see several errors in the dest. system's syslog:&lt;BR /&gt;&lt;BR /&gt;sshd[2953]: error: getsockname failed: Invalid argument&lt;BR /&gt;&lt;BR /&gt;Thoughts?&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Thu, 01 Sep 2005 09:13:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616832#M104561</guid>
      <dc:creator>erics_1</dc:creator>
      <dc:date>2005-09-01T09:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616833#M104562</link>
      <description>The other thing pointed out by Doug is that the script does not use your ssh-key. If it runs well from the command line then the diff there is being that the keys are possibly being used.&lt;BR /&gt;&lt;BR /&gt;if you have an ssh-key that uses a passphrase, you need to cache the passprase w/ ssh-agent and tell the script to use the already running ssh-agent... or keep it simple and setup a key w/ out a passphrase and limit access of that key from directive s prepended to the key in .authorized_keys file.&lt;BR /&gt;&lt;BR /&gt;so could be your orignal script was fine afterall, just failed in cron because it didn't use the ssh-agent you had running when the script was manually kicked off.&lt;BR /&gt;&lt;BR /&gt;-denver&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Sep 2005 09:15:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616833#M104562</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2005-09-01T09:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616834#M104563</link>
      <description>doh.&lt;BR /&gt;&lt;BR /&gt;go back to your original script... do what doug said. :)&lt;BR /&gt;&lt;BR /&gt;this: ssh -l root hostname&lt;BR /&gt;&lt;BR /&gt;to this: ssh -i /path/to/your__passwordless_key -l root hostname&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if all else fails, also use the "-vvv" w/the above ssh syntax change to see what's happening.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Sep 2005 09:19:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616834#M104563</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2005-09-01T09:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: ssh command within script gives "select: Invalid argument" error.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616835#M104564</link>
      <description>sshd[2953]: error: getsockname failed: Invalid argument&lt;BR /&gt;Makes me think, Any firewalls in between?? The sshd by default listens to port 22. Is that port open in firewall??&lt;BR /&gt;&lt;BR /&gt;Also you can run sshd -ddd and get more verbose details about error message.&lt;BR /&gt;&lt;BR /&gt;Also as you are running through cron, make sure that you have all required variables set properly. Intentionally cron environment is very sparse.</description>
      <pubDate>Thu, 01 Sep 2005 09:19:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-command-within-script-gives-quot-select-invalid-argument/m-p/3616835#M104564</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-09-01T09:19:22Z</dc:date>
    </item>
  </channel>
</rss>

