Commit 31465dca authored by Guido Günther's avatar Guido Günther Committed by Guido Günther

allow non root users for ssh connections

Closes: #505936
parent 3ed3a88c
From 0d49c956e6c5e0a3b5965b8dd4f70d3e8629a634 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Thu, 4 Dec 2008 20:36:27 +0100
Subject: [PATCH] allow non root users for ssh connections
by specifying user@host in the "Add connection..." dialog. Default to
root if no name was given.
---
src/virtManager/connect.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/virtManager/connect.py b/src/virtManager/connect.py
index dcb9278..33a173b 100644
--- a/src/virtManager/connect.py
+++ b/src/virtManager/connect.py
@@ -217,6 +217,11 @@ class vmmConnect(gobject.GObject):
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
@@ -226,7 +231,8 @@ class vmmConnect(gobject.GObject):
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:
@@ -235,7 +241,7 @@ class vmmConnect(gobject.GObject):
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"
--
1.6.0.3
......@@ -6,3 +6,4 @@
0006-fix-sorting-exceptions.patch
0007-populate-hostinfo-earlier-in-tick-function-so-it-isn.patch
0008-qemu-session-can-t-write-to-the-pool-so-use-curren.patch
0009-allow-non-root-users-for-ssh-connections.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment