Skip to content

Commit

Permalink
Fix ssh host-checking bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablyFaiz committed Mar 27, 2024
1 parent b346196 commit 352eecf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ def ssh(node: str):
node = node or credentials["node"]
node_url = f"{node}.sherlock.stanford.edu"
rich.print(f"[green]Logging you in to {node_url}[/green]")
ssh_command = f"ssh {credentials['username']}@{node_url}"
ssh_command = (
f"ssh -o StrictHostKeyChecking=no {credentials['username']}@{node_url}"
)
_run_sherlock_ssh(ssh_command, credentials, duo)


Expand All @@ -361,10 +363,11 @@ def scp(direction: str, source: str, destination: str, scp_options: list[str]):
node = credentials["node"]
node_url = f"{node}.sherlock.stanford.edu"
rich.print(f"[green]Logging in to {node_url}[/green]")
scp_prefix = "scp -o StrictHostKeyChecking=no"
scp_command = (
f"scp {' '.join(scp_options)} {source} {credentials['username']}@{node_url}:{destination}"
f"{scp_prefix} {' '.join(scp_options)} {source} {credentials['username']}@{node_url}:{destination}"
if direction == "to"
else f"scp {' '.join(scp_options)} {credentials['username']}@{node_url}:{source} {destination}"
else f"{scp_prefix} {' '.join(scp_options)} {credentials['username']}@{node_url}:{source} {destination}"
)
_run_sherlock_ssh(scp_command, credentials, duo)

Expand Down

0 comments on commit 352eecf

Please sign in to comment.