Ubuntu

sshpass 1.04 hangs - use 1.05

Reported by Alrond on 2011-05-01
78
This bug affects 16 people
Affects Status Importance Assigned to Milestone
sshpass (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: sshpass

Description: Ubuntu 11.04
sshpass: 1.04-1
ssh: 1:5.8p1-1ubuntu3

Doesn't send the password to ssh. Freeze on the last line(see bottom).
In ubuntu 10.10 works perfectly. Problem is coming after upgrade to natty.
I have tried all variants (-p -e -f), in bash, sh, csh.

#sshpass -e ssh -v user@192.168.178.220
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to zabbix [192.168.178.220] port 22.
[skip]
debug1: Next authentication method: password

Luis Fabiani (luis-fabiani) wrote :

Realiced tests:
- 1.04-1 not working
- 1.04 not working, fails on the same place
- 1.03 works

Luis Fabiani (luis-fabiani) wrote :

It's related to ssh pass 3118311 "1.04 fails with openssh 5.6".

Applying the fix by anonymous on http://sourceforge.net/tracker/?func=detail&aid=3118311&group_id=156659&atid=800672 solves it.

sshpass last version is from 2008 and seems to be dead. This patch should be aproved by ubuntu team.

Juliano Jeziorny (djkadu) wrote :

confirmed the issue is fixed by changing the line 314 as per last comment on the page above mentioned.

[quote]
A simpler fix is to change line 314 to

if( numread<0 && errno!=5 ) {
[/quote]

Uroš Gaber (uros-gaber) wrote :

Juliano Jeziorny fixed the problem. It now works for me after I compiled sshpass myself.

Uroš Gaber (uros-gaber) wrote :

I noticed that now sshpass is using 100% of 1 core cpu.

Juliano Jeziorny (djkadu) wrote :

Hi Uros,

Indeed I have the same problem after this change. sshpass is using 100% CPU

This was a previous issue and according to the following has been fixed: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502585

Also the changelog shows it has been fixed on version 1.01-2: https://launchpad.net/ubuntu/+source/sshpass/+changelog

I've tried to download the source from repository and perform the line 314 change there but the problem persist.

JJ

Thomas Mathew (tm1729) wrote :

It works for me too. Great relief

[quote]
A simpler fix is to change line 314 to

if( numread<0 && errno!=5 ) {
[/quote]

Changed in sshpass (Ubuntu):
status: New → Confirmed
Thomas Mathew (tm1729) wrote :

After the fix, sshpass is using up 100% of my cpu, making it useless :(

Rigo Schultz (schultz-h) wrote :

diff -u main.c.org main.c

--- main.c.org 2011-06-08 16:04:27.868884290 +0200
+++ main.c 2011-06-09 12:11:30.512715993 +0200
@@ -280,6 +280,7 @@
   }
      }
      wait_id=waitpid( childpid, &status, WNOHANG );
+ sleep(2);
  } else {
      wait_id=waitpid( childpid, &status, 0 );
  }
@@ -311,7 +312,7 @@

     int numread=read(fd, buffer, sizeof(buffer) );

- if( numread<0 ) {
+ if( numread<0 && errno!=5) {
         // Comment no. 3.1416
         // Select is doing a horrid job of waking us up at the right time - it wakes up with "read ready" when the slave
         // end of the pty is closed. This result in an IO error when we perform a read. In the general case, this does

Juliano Jeziorny (djkadu) wrote :

Thanks Rigo,

Just applied your change, so far looks good.

Juliano Jeziorny (djkadu) wrote :

just to add,
the sleep is a little annoying though. As we have to wait those 2 seconds when you open and close the connection.

Uroš Gaber (uros-gaber) wrote :

It still doesn't work in oneiric.

Ari (ari-reads) wrote :

is there any workaround or alternative package to sshpass that works in ubuntu?

Try using public key identification (for example,
http://www.petefreitag.com/item/532.cfm )

2011/10/29 Ari <email address hidden>:
> is there any workaround or alternative package to sshpass that works in
> ubuntu?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/774882
>
> Title:
>  doesn't work in natty
>
> Status in “sshpass” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  Binary package hint: sshpass
>
>  Description:    Ubuntu 11.04
>  sshpass: 1.04-1
>  ssh: 1:5.8p1-1ubuntu3
>
>  Doesn't send the password to ssh. Freeze on the last line(see bottom).
>  In ubuntu 10.10 works perfectly. Problem is coming after upgrade to natty.
>  I have tried all variants (-p -e -f), in bash, sh, csh.
>
>  #sshpass -e ssh -v user@192.168.178.220
>  OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
>  debug1: Reading configuration data /etc/ssh/ssh_config
>  debug1: Applying options for *
>  debug1: Connecting to zabbix [192.168.178.220] port 22.
>  [skip]
>  debug1: Next authentication method: password
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/sshpass/+bug/774882/+subscriptions
>

sshpass 1.05 had been released: http://sourceforge.net/projects/sshpass/files/sshpass/1.05/

This is their change log:

Version 1.05
 * OpenSSH version 5.6 closed our leaked slave PTY fd, breaking sshpass.
   This reverted the "better detection of child exit", unfortunately.
 * Update the manual page about changes.
 * Print usage information if no arguments given.

Can someone pls try?

Juliano Jeziorny (kadu) wrote :

just installed 1.05, looks good.

no high cpu usage and no delayed connect/disconnection

Thanks, will use it for a while and report if any errors found.

davepc (dave-p-clarke) wrote :

Installed 1.05 from sources and it works.

1.05 will be included in Precise. But shouldn't it also be included in all releases back to Lucid 10.4 since its LTS?

What is the process for requesting this?

Otherwise many more users will experience this problem and have to search and install from sources.

davepc (dave-p-clarke) on 2012-03-13
tags: added: 10.4 11.10 lucid oneiric
summary: - doesn't work in natty
+ sshpass 1.04 hangs - use 1.05
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.