X2Go Bug report logs - #1586
pyhoca-cli does not honor the -k (--ssh-privkey) option

version graph

Package: pyhoca-cli; Maintainer for pyhoca-cli is X2Go Developers <x2go-dev@lists.x2go.org>; Source for pyhoca-cli is src:pyhoca-cli.

Reported by: Eric Monson <ericjmonson@gmail.com>

Date: Fri, 15 Apr 2022 00:20:01 UTC

Severity: normal

Found in version 0.4.0.3

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1586; Package pyhoca-cli. (Fri, 15 Apr 2022 00:20:02 GMT) (full text, mbox, link).


Acknowledgement sent to Eric Monson <ericjmonson@gmail.com>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Fri, 15 Apr 2022 00:20:02 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

From: Eric Monson <ericjmonson@gmail.com>
To: submit@bugs.x2go.org
Subject: pyhoca-cli does not honor the -k (--ssh-privkey) option
Date: Thu, 14 Apr 2022 18:16:35 -0600
[Message part 1 (text/plain, inline)]
Package: pyhoca-cli
Version: 0.4.0.3

I've created a session and defined a private key (not at the location
~/.ssh/id_rsa). In the command line, I run "pyhocal-cli -k <private_key>
...".  However, pyhoca-cli still attempts to use ~/.ssh/id_rsa.

Here's what I believe happens:
x2go/defaults.py: autologin is defaulted to True
x2go/utils.py: autologin is translated to 'look_for_keys', so look_for_keys
is now set to True
x2go/backends/control/plain.py (in the function connect): We hit is
following if statement:
  if look_for_keys:
    key_filename = None
    pkey = None
(so key_filename and pkey are cleared)

Finally in backends/control/plain.py, we hit the if statement that calls
one of 3 paramiko connect calls. However, since key_filename and pkey are
set to None, but look_for_keys is set to true, the software ends up trying
to use the ~/.ssh/id_rsa file, if that doesn't work, it will then ask for a
password, but never uses the passed in private key.

If you comment out the if statement in "plain.py":
  if look_for_keys:
    key_filename = None
    pkey = None

then the software does in fact use the private key passed in at the command
line. I don't know why that if statement is there. I'm sure there is a
reason, but don't know the codebase well enough to say that would be a
global fix.
[Message part 2 (text/html, inline)]

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1586; Package pyhoca-cli. (Mon, 15 Jan 2024 20:45:02 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Mon, 15 Jan 2024 20:45:02 GMT) (full text, mbox, link).


Message #10 received at 1586@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 1586@bugs.x2go.org
Subject: Closing...
Date: Mon, 15 Jan 2024 20:42:37 +0000
[Message part 1 (text/plain, inline)]
Control: close -1

We are migrating our debbugs bug tracker instance to X2Go GitLab's  
issue tracker.

This issue is probably resolved by MR!5 at
https://gitlab.x2go.org/x2go/client/libs/python-x2go/-/merge_requests/5

Thus, closing...

Mike

-- 

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

[Message part 2 (application/pgp-signature, inline)]

Marked Bug as done Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to 1586-submit@bugs.x2go.org. (Mon, 15 Jan 2024 20:45:02 GMT) (full text, mbox, link).


Notification sent to Eric Monson <ericjmonson@gmail.com>:
Bug acknowledged by developer. (Mon, 15 Jan 2024 20:45:03 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.x2go.org> to internal_control@bugs.x2go.org. (Tue, 13 Feb 2024 06:24:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Fri Apr 19 06:38:20 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.