Unable to specify ssh parameters

Bug #546698 reported by quequotion
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sshsplit
Confirmed
High
Martin Eve
Stable
Confirmed
Undecided
Martin Eve

Bug Description

I can see how this works with an ssh tunnel that has no password and uses the standard port (22). I need to specify several such parameters however. Perhaps I just missed something?

I tried putting these in the "process arguments" section, but that doesn't seem to work.

Specifically, I want to do this:

ssh -fN -p 2222 -D 1080 root@127.0.0.1

How can I specify to use 2222 as the ssh port and to login as root, which should prompt for a password? (These options are absolutely necessary for my ssh tunnel, -fN is not so important however).

When I put those arguments in "process arguments", sshsplit outputs:

Traceback (most recent call last):
  File "/usr/bin/sshsplit", line 132, in on_btnBegin_clicked
    listenhost, listenport)
  File "/usr/bin/sshsplit", line 190, in __init__
    self.listenport = int(listenport)
ValueError: invalid literal for int() with base 10: ''
Starting 5 SSH instances.
Started SSH on port 1081.
Launching ssh - f N - p 2 2 2 2 r o o t @ 1 2 7 . 0 . 0 . 1
Started SSH on port 1082.
Launching ssh - f N - p 2 2 2 2 r o o t @ 1 2 7 . 0 . 0 . 1
Launching ssh - f N - p 2 2 2 2 r o o t @ 1 2 7 . 0 . 0 . 1
Started SSH on port 1083.
Started SSH on port 1084.
Launching ssh - f N - p 2 2 2 2 r o o t @ 1 2 7 . 0 . 0 . 1
Started SSH on port 1085.
 Launching ssh - f N - p 2 2 2 2 r o o t @ 1 2 7 . 0 . 0 . 1
Child process died.
Child process died.
Child process died.
Child process died.
Child process died.

I also tried typing the binary line as "ssh -p 2222 root@127.0.0.1" and leaving "listen host" blank:

Starting 5 SSH instances.
Started SSH on port 1081.
Launching ssh -p 2222 root@127.0.0.1 -ND 1081
Started SSH on portLaunching ssh -p 2222 root@127.0.0.1 -ND 1082
 1082.
Started SSH on port 1083.
Launching ssh -p 2222 root@127.0.0.1 -ND 1083
Started SSH on port 1084.
Launching ssh -p 2222 root@127.0.0.1 -ND 1084
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/bin/sshsplit", line 224, in run
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Launching ssh -p 2222 root@127.0.0.1 -ND 1085 Started SSH on port 1085.

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/bin/sshsplit", line 224, in run
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/bin/sshsplit", line 224, in run
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/bin/sshsplit", line 224, in run
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Exception in thread Thread-6:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/bin/sshsplit", line 224, in run
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I was expecting an ssh tunnel to be created on port 1080, but I don't see any output to that effect (shall I try -v on the command line?) and also, in each case sshsplit must be "kill -9" terminted. None of the ssh processes survive either, but I am not sure if that's because they die waiting for a password or sshsplit can't pass the arguments I specified, or boh.(..?)

Revision history for this message
Martin Eve (martineve) wrote :

Hi,

Many thanks for the report. This raises two, separate issues. (and alerted me to a third)

1.) You can do what you want with this syntax:

autossh -a "-p 2222" -s 1080 root@127.0.0.1

Note the quotes around the process arguments.

This does:

Process arguments: -p 2222
Start port: 1080 (will spawn ssh dynamic tunnels on 1080, 1081, 1082, 1083, 1084)

*However*: this brought to my attention a bug in the code that parses "-s", so that will be fixed in 0.4. (Also fixed in code)

2.) Using this method will prompt for your password. Just make sure not to pass the "-d" flag, because if it daemonizes it won't ask.

3.) Processess needing to be killed with -9 is on my todo list!

Martin Eve (martineve)
Changed in sshsplit:
status: New → Confirmed
milestone: none → 0.4
status: Confirmed → Fix Committed
importance: Undecided → High
Martin Eve (martineve)
Changed in sshsplit:
status: Fix Committed → Fix Released
Revision history for this message
quequotion (quequotion) wrote :

Thank you for the quick response and the fast work!

I'll give this another try in a moment.

Revision history for this message
quequotion (quequotion) wrote :

In 0.4, when I try that command I'm not getting any further :(

I added -v because it didn't output anything other than the no warranty and redistribution information.

It claims to launch (*=0-5):

ssh -ND 108* root@127.0.0.1 - p 2 2 2 2

unfortunately there is still no password prompt (I'm expecting one for each instance actually) and all the ssh processes die after a few seconds. It also bothers me that the port parameter is spaced out like that in the verbose output; I have no way to know if it is a mistake in the output itself or if sshsplit is trying to execute a command like that, which of course does not work (I tried!)

Revision history for this message
Martin Eve (martineve) wrote :

Hi,

My apologies; there is, still, a bug in the code whereby it is inserting spaces between each character passed into the -a argument.

It looks like it is in these lines:

        # append any process arguments
        for arg in self.procargs:
            self.openargs.append(arg)

        if self.verbose:
            print "Launching %s" %(" ".join(self.openargs))

I'll try and have a look over the next day and release a fix. Apologies again.

Martin

Changed in sshsplit:
status: Fix Released → Confirmed
milestone: 0.4 → 0.5
assignee: nobody → Martin Eve (martineve)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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