Re: [PATCH] virt-manager: allow non root users for ssh://

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 04, 2008 at 08:33:54PM +0100, Guido Günther wrote:
> Hi,
> attached patch allows to specify a user with user@host for ssh
> connections in the "Add connection..." dialog. This has been requested
> e.g. in:
>  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505936
Patch attached now.
 -- Guido
# HG changeset patch
# User Guido Günther <agx@xxxxxxxxxxx>
# Date 1228418962 -3600
# Node ID 6a29ab18aba161bdf1c2d1b1492439e5cb293ac0
# Parent  590b9afe9e7d50f5ea733b290b1255fc78e8fb9f
Allow different username for <hv>+ssh://

diff -r 590b9afe9e7d -r 6a29ab18aba1 src/virtManager/connect.py
--- a/src/virtManager/connect.py	Mon Dec 01 14:37:58 2008 -0500
+++ b/src/virtManager/connect.py	Thu Dec 04 20:29:22 2008 +0100
@@ -216,6 +216,11 @@
             auto = self.window.get_widget("autoconnect").get_active()
         uri = None
 
+        if conn == CONN_SSH and '@' in host:
+            user, host = host.split('@',1)
+        else:
+            user = "root"
+
         readOnly = None
         if hv == -1:
             pass
@@ -225,7 +230,8 @@
             elif conn == CONN_TLS:
                 uri = "xen+tls://" + host + "/"
             elif conn == CONN_SSH:
-                uri = "xen+ssh://root@" + host + "/"
+
+                uri = "xen+ssh://" + user + "@" + host + "/"
             elif conn == CONN_TCP:
                 uri = "xen+tcp://" + host + "/"
         else:
@@ -234,7 +240,7 @@
             elif conn == CONN_TLS:
                 uri = "qemu+tls://" + host + "/system"
             elif conn == CONN_SSH:
-                uri = "qemu+ssh://root@" + host + "/system"
+                uri = "qemu+ssh://" + user + "@" + host + "/system"
             elif conn == CONN_TCP:
                 uri = "qemu+tcp://" + host + "/system"
 
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux