Skip to content

Commit

Permalink
Fix the equivalent of ssh-copy-id, now works!
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed Nov 6, 2023
1 parent 845e313 commit 61d608c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions milatools/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,12 @@ def init():
):
# NOTE: If we're on a Windows machine, we do something different here:
if sys.platform == "win32":
here.run(
'cat ~/.ssh/id_rsa.pub | ssh mila "cat >> ~/.ssh/authorized_keys"'
command = (
"powershell.exe type $env:USERPROFILE\\.ssh\\id_rsa.pub | ssh mila "
'"cat >> ~/.ssh/authorized_keys"'
)
print(T.bold_green("(local) $ " + command))
subprocess.getoutput(command)
else:
here.run("ssh-copy-id", "mila")
if not here.check_passwordless("mila"):
Expand Down

0 comments on commit 61d608c

Please sign in to comment.