Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strudel2_backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
strudel2_backend
Commits
74c3275c
Commit
74c3275c
authored
5 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
warning about host keys
parent
3bb8f18e
No related branches found
No related tags found
3 merge requests
!77
Revert "disable agressive kill and restart"
,
!35
Dev
,
!17
Dev
Pipeline
#7920
canceled
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TES/tes/sshwrapper/__init__.py
+9
-2
9 additions, 2 deletions
TES/tes/sshwrapper/__init__.py
with
9 additions
and
2 deletions
TES/tes/sshwrapper/__init__.py
+
9
−
2
View file @
74c3275c
...
@@ -95,6 +95,7 @@ class Ssh:
...
@@ -95,6 +95,7 @@ class Ssh:
sshcmd
=
[
"
ssh
"
,
'
-o
'
,
'
StrictHostKeyChecking=no
'
,
sshcmd
=
[
"
ssh
"
,
'
-o
'
,
'
StrictHostKeyChecking=no
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
"
-S
"
,
ctrlsocket
,
"
-S
"
,
ctrlsocket
,
"
-M
"
,
'
-o
'
,
'
ControlPersist=10m
'
,
"
-M
"
,
'
-o
'
,
'
ControlPersist=10m
'
,
'
-p
'
,
sshport
,
'
-N
'
,
'
-l
'
,
user
,
host
]
'
-p
'
,
sshport
,
'
-N
'
,
'
-l
'
,
user
,
host
]
...
@@ -179,6 +180,7 @@ class Ssh:
...
@@ -179,6 +180,7 @@ class Ssh:
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-P
'
,
sshport
,
'
-o
'
,
'
ControlPath={}
'
.
format
(
ctrlsocket
),
'
-P
'
,
sshport
,
'
-o
'
,
'
ControlPath={}
'
.
format
(
ctrlsocket
),
'
{}@{}
'
.
format
(
user
,
host
)],
'
{}@{}
'
.
format
(
user
,
host
)],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
...
@@ -229,6 +231,7 @@ class Ssh:
...
@@ -229,6 +231,7 @@ class Ssh:
exec_p
=
subprocess
.
Popen
([
'
sftp
'
,
'
-b
'
,
'
-
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
exec_p
=
subprocess
.
Popen
([
'
sftp
'
,
'
-b
'
,
'
-
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-P
'
,
sshport
,
'
-o
'
,
'
ControlPath={}
'
.
format
(
ctrlsocket
),
'
-P
'
,
sshport
,
'
-o
'
,
'
ControlPath={}
'
.
format
(
ctrlsocket
),
'
{}@{}
'
.
format
(
user
,
host
)],
'
{}@{}
'
.
format
(
user
,
host
)],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
...
@@ -284,13 +287,14 @@ class Ssh:
...
@@ -284,13 +287,14 @@ class Ssh:
sshcmd
=
[
'
ssh
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
sshcmd
=
[
'
ssh
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-o
'
,
'
ConnectTimeout=10
'
,
'
-o
'
,
'
ConnectTimeout=10
'
,
'
-S
'
,
ctrlsocket
,
'
-p
'
,
sshport
,
'
-S
'
,
ctrlsocket
,
'
-p
'
,
sshport
,
'
-l
'
,
user
,
host
,
cmd
]
'
-l
'
,
user
,
host
,
cmd
]
else
:
else
:
# we are executing on a node (e.g. a compute/batch node) using a bastion (e.g. login node)
# we are executing on a node (e.g. a compute/batch node) using a bastion (e.g. login node)
# at the moment I'll assume the ssh port for the batch host is the same as the ssh port for the bastion/login host
# at the moment I'll assume the ssh port for the batch host is the same as the ssh port for the bastion/login host
proxycmd
=
"
ssh -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o UpdateHostKeys=no -o Stricthostkeychecking=no {user}@{bastion} -W {host}:{sshport} -S {ctrlsocket}
"
.
format
(
proxycmd
=
"
ssh -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o UpdateHostKeys=no -o
LogLevel=error -o
Stricthostkeychecking=no {user}@{bastion} -W {host}:{sshport} -S {ctrlsocket}
"
.
format
(
user
=
user
,
host
=
host
,
user
=
user
,
host
=
host
,
ctrlsocket
=
ctrlsocket
,
ctrlsocket
=
ctrlsocket
,
sshport
=
sshport
,
sshport
=
sshport
,
...
@@ -299,6 +303,7 @@ class Ssh:
...
@@ -299,6 +303,7 @@ class Ssh:
'
-o
'
,
"
ProxyCommand={}
"
.
format
(
proxycmd
),
'
-o
'
,
"
ProxyCommand={}
"
.
format
(
proxycmd
),
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-o
'
,
'
ConnectTimeout=10
'
,
'
-o
'
,
'
ConnectTimeout=10
'
,
'
-p
'
,
bastionsshport
,
'
-l
'
,
user
,
bastion
,
cmd
]
'
-p
'
,
bastionsshport
,
'
-l
'
,
user
,
bastion
,
cmd
]
exec_p
=
subprocess
.
Popen
(
sshcmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
env
=
env
)
exec_p
=
subprocess
.
Popen
(
sshcmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
env
=
env
)
...
@@ -361,6 +366,7 @@ class Ssh:
...
@@ -361,6 +366,7 @@ class Ssh:
sshcmd
=
[
'
ssh
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
'
-N
'
,
sshcmd
=
[
'
ssh
'
,
'
-o
'
,
'
Stricthostkeychecking=no
'
,
'
-N
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-L
'
,
'
{localport}:{batchhost}:{port}
'
.
'
-L
'
,
'
{localport}:{batchhost}:{port}
'
.
format
(
port
=
port
,
localport
=
localport
,
batchhost
=
batchhost
),
format
(
port
=
port
,
localport
=
localport
,
batchhost
=
batchhost
),
'
-O
'
,
'
forward
'
,
'
-S
'
,
ctrlsocket
,
'
-O
'
,
'
forward
'
,
'
-S
'
,
ctrlsocket
,
...
@@ -369,7 +375,7 @@ class Ssh:
...
@@ -369,7 +375,7 @@ class Ssh:
# Create an ssh tunnel to the batch node using a proxycommand.
# Create an ssh tunnel to the batch node using a proxycommand.
# The proxy command should utilise
# The proxy command should utilise
# the existing control master connection
# the existing control master connection
proxycmd
=
"
ssh -o UserKnownHostsFile=/dev/null -o UpdateHostKeys=no -o Stricthostkeychecking=no {user}@{host} -W {batchhost}:22 -S {ctrlsocket}
"
.
format
(
proxycmd
=
"
ssh -o UserKnownHostsFile=/dev/null -o UpdateHostKeys=no -o
LogLevel=error -o
Stricthostkeychecking=no {user}@{host} -W {batchhost}:22 -S {ctrlsocket}
"
.
format
(
user
=
user
,
host
=
host
,
user
=
user
,
host
=
host
,
ctrlsocket
=
ctrlsocket
,
ctrlsocket
=
ctrlsocket
,
batchhost
=
batchhost
)
batchhost
=
batchhost
)
...
@@ -378,6 +384,7 @@ class Ssh:
...
@@ -378,6 +384,7 @@ class Ssh:
format
(
port
=
port
,
localport
=
localport
),
format
(
port
=
port
,
localport
=
localport
),
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UserKnownHostsFile=/dev/null
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
UpdateHostKeys=no
'
,
'
-o
'
,
'
LogLevel=error
'
,
'
-o
'
,
"
ProxyCommand={}
"
.
format
(
proxycmd
),
'
-o
'
,
"
ProxyCommand={}
"
.
format
(
proxycmd
),
'
-p
'
,
sshport
,
'
-l
'
,
user
,
batchhost
]
'
-p
'
,
sshport
,
'
-l
'
,
user
,
batchhost
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment