We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c44cae6 commit dac79c7Copy full SHA for dac79c7
1 file changed
src/sagemaker/modules/train/container_drivers/mpi_utils.py
@@ -76,6 +76,16 @@ def start_sshd_daemon():
76
77
78
class CustomHostKeyPolicy(paramiko.client.MissingHostKeyPolicy):
79
+ """Class to handle host key policy for SageMaker distributed training SSH connections.
80
+ Example:
81
+ >>> client = paramiko.SSHClient()
82
+ >>> client.set_missing_host_key_policy(CustomHostKeyPolicy())
83
+ >>> # Will succeed for SageMaker algorithm containers
84
+ >>> client.connect('algo-1234.internal')
85
+ >>> # Will raise SSHException for other unknown hosts
86
+ >>> client.connect('unknown-host') # raises SSHException
87
+ """
88
+
89
def missing_host_key(self, client, hostname, key):
90
"""Accept host keys for algo-* hostnames, reject others.
91
0 commit comments