xpipe-io / xpipe

Your entire server infrastructure at your fingertips
https://xpipe.io
Apache License 2.0
3.06k stars 82 forks source link

XPipe don't use ssh-agent (Win10) #290

Closed suhrke closed 1 month ago

suhrke commented 3 months ago

Hello, I just installed XPipe 10.0.2 and ssh-agent. Using powershell I can connect to an internet host I can only connect with ssh key. With XPipe it don't work

io.xpipe.core.process.ProcessOutputException: Shell opener command was unsuccessful: Operation was cancelled Permission denied, please try again. Operation was cancelled Permission denied, please try again. Operation was cancelled suhrke@james.suhrke.net: Permission denied (publickey,password). << !!! at io.xpipe.core.process.ProcessOutputException.withPrefix(ProcessOutputException.java:29) at io.xpipe.ext.proc.util.f.a(SourceFile:321) at io.xpipe.ext.proc.l.n(SourceFile:2578) at io.xpipe.ext.proc.ssh.r.n(SourceFile:88) at io.xpipe.ext.proc.l.C(SourceFile:489) at io.xpipe.ext.proc.l.start(SourceFile:225) at io.xpipe.app.util.ScanAlert$Dialog.lambda$content$11(ScanAlert.java:188) at io.xpipe.app.util.BooleanScope.executeExclusive(BooleanScope.java:18) at io.xpipe.app.util.ScanAlert$Dialog.lambda$content$12(ScanAlert.java:180) at io.xpipe.app.util.ThreadHelper.lambda$runFailableAsync$1(ThreadHelper.java:42) at io.xpipe.app.util.ThreadHelper.lambda$wrap$0(ThreadHelper.java:19) at java.lang.VirtualThread.run(VirtualThread.java:309)

What's going wrong?

crschnick commented 3 months ago

The default behavior of SSH is to ask for a password if key-based authentication failed. (Even if there is no password to login with) So for some reason it seems like the key-based auth fails here.

How does the command look like when are you connecting with powershell?

suhrke commented 3 months ago

hello, there are mutiple servers in internet, I secured by disabling password login. Normally I connect them by Mobaxterm with key authentication. Now I installed XPipe and ssh-agent and tried to use XPipe for this connections and it failed, because XPipe didn't used ssh-agent. Also starting pagent didn't help more, same problem. Connection at powershell worked simple with ssh @.***, both with unprivileged user as well with root. The failure messages from XPipe I included in the ticket. In case of internal server, where I allow password auth, the connection worked after password intake. I hope this helps allocation the error source. Best regards Klaus-Dieter

Am 30. Juni 2024 23:02:25 MESZ schrieb Christopher Schnick @.***>:

The default behavior of SSH is to ask for a password if key-based authentication failed. (Even if there is no password to login with) So for some reason it seems like the key-based auth fails here.

How does the command look like when are you connecting with powershell?

-- Reply to this email directly or view it on GitHub: https://github.com/xpipe-io/xpipe/issues/290#issuecomment-2198756441 You are receiving this because you authored the thread.

Message ID: @.***> -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

suhrke commented 3 months ago

Hallo Christian,

anbei mal ein screenshot des ssh login auf einem meiner Server. Einmal aus der powershell mit dem windows ssh client und ssh-agent einmal mit putty Es würde mich freuen, wenn das mit XPipe ebenfall funktionieren würde. Gruß Klaus-Dieter

PS:

eine Ergänzung habe ich noch: verwende ich für die Authentisierung keinen ssh agent, sondern gebe via Identitätsdatei den Schlüssel und die dazugehörige Passphrase direkt ein, funktioniert die Verbindung wie gewünscht. Das Problem liegt also beim Aufruf des Agents durch XPipe. Wenn ich an dieses Stelle bei der Eingrenzung des Fehlers weiterhelfen kann, bin ich gerne dabei.

Ansonsten bin ich über die Möglichkeiten von XPipe wirklich begeistert. Das Zusammenspiel von ssh, proxmox, docker etc. ist wirklich klasse - chapeau.

PPS: der Upload der Screenshots scheint hier nicht gut zu funktionieren

Gruß Klaus-Dieter

crschnick commented 3 months ago

Unter Windows sind die Konfigurationen des ssh-Agenten immer recht seltsam. Es hängt davon ab, was in den Powershell-Profilen eingerichtet ist (falls diese verwendet werden) und mehr. Außerdem kommen sich der OpenSSH-Agent und Pageant gegenseitig in die Quere, und wenn beide gleichzeitig aktiv sind, funktioniert das nicht.

Aber wenn das einfache Ausführen von ssh user@host in Powershell automatisch verbindet, vermute ich, dass die Agentenkonfiguration nur für die Powershell auf dem System gilt (xpipe verwendet normalerweise cmd.exe). Was passiert, wenn das lokale Powershell shell environment als SSH-Gateway in xpipe verwendet wird?

image

crschnick commented 3 months ago

Ich habe den Fehler-Bericht erhalten, das heißt, es funktioniert immer noch nicht. Wenn ssh-add -l in einem Terminal ausgeführt wird, was ist die Ausgabe?

Denn eigentlich macht xpipe genau das gleiche wie ssh user@host in einer Shell ausführen.

crschnick commented 1 month ago

Closing this as inactive, feel free to reopen if you have any updates