Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
45e09d5e
authored
Feb 06, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laborclient: Added sshterm support
parent
87170279
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
miscellaneous/laborclient/rdp.py
+11
-12
No files found.
miscellaneous/laborclient/rdp.py
View file @
45e09d5e
...
@@ -25,8 +25,8 @@ class RDP:
...
@@ -25,8 +25,8 @@ class RDP:
self
.
connect_rdp
()
self
.
connect_rdp
()
elif
self
.
scheme
==
"nx"
:
elif
self
.
scheme
==
"nx"
:
self
.
connect_nx
()
self
.
connect_nx
()
elif
self
.
scheme
==
"s
hell
term"
:
elif
self
.
scheme
==
"s
sh
term"
:
self
.
connect_term
()
self
.
connect_
ssh
term
()
else
:
else
:
return
False
return
False
def
get_temporary_file
(
self
):
def
get_temporary_file
(
self
):
...
@@ -38,6 +38,15 @@ class RDP:
...
@@ -38,6 +38,15 @@ class RDP:
os
.
unlink
(
tmpfile
.
name
)
os
.
unlink
(
tmpfile
.
name
)
return
self
.
get_temporary_file
()
return
self
.
get_temporary_file
()
def
connect_sshterm
(
self
):
#try:
ssh_subcommand
=
'sshpass -p "
%(password)
s" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
%(username)
s@
%(host)
s -p
%(port)
s'
\
%
{
'username'
:
self
.
username
,
'password'
:
self
.
password
,
'host'
:
self
.
host
,
'port'
:
self
.
port
}
ssh_command
=
[
"gnome-terminal"
,
"-e"
,
ssh_subcommand
]
proc
=
subprocess
.
check_call
(
ssh_command
,
stdout
=
subprocess
.
PIPE
)
#except:
# print "Error"
def
connect_rdp
(
self
):
def
connect_rdp
(
self
):
rdp_command
=
[
"rdesktop"
,
"-khu"
,
"-E"
,
"-P"
,
"-0"
,
"-f"
,
"-u"
,
self
.
username
,
"-p"
,
self
.
password
,
self
.
host
+
":"
+
self
.
port
]
rdp_command
=
[
"rdesktop"
,
"-khu"
,
"-E"
,
"-P"
,
"-0"
,
"-f"
,
"-u"
,
self
.
username
,
"-p"
,
self
.
password
,
self
.
host
+
":"
+
self
.
port
]
try
:
try
:
...
@@ -45,16 +54,6 @@ class RDP:
...
@@ -45,16 +54,6 @@ class RDP:
except
:
except
:
self
.
dialog_box
(
"Unable to connect to host: "
+
self
.
host
+
" at port "
+
self
.
port
)
self
.
dialog_box
(
"Unable to connect to host: "
+
self
.
host
+
" at port "
+
self
.
port
)
#
# rdesktop -khu -E -P -0 -f -u "$user" -p "$password" "$host":"$port" 2>$tmp
# if grep '^ERROR' <$tmp
# then
# err="$(grep '^ERROR' $tmp)"
# rm /home/user/.ssh/known_hosts
# /usr/NX/bin/nxclient --dialog error --message "$err" &
# fi
# rm $tmp
#
def
connect_nx
(
self
):
def
connect_nx
(
self
):
#Generate temproary config
#Generate temproary config
password_enc
=
nxkey
.
NXKeyGen
(
self
.
password
)
.
getEncrypted
()
password_enc
=
nxkey
.
NXKeyGen
(
self
.
password
)
.
getEncrypted
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment