From ff6e88296d340a7dc8ece09c35c5921a438b6df8 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Thu, 9 Sep 2021 01:51:02 +0300 Subject: [PATCH] ssh: support passphrases for private keys (#6566) --- dvc/fs/ssh.py | 1 + tests/unit/fs/test_ssh.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dvc/fs/ssh.py b/dvc/fs/ssh.py index 23f15f888..1947b3d6f 100644 --- a/dvc/fs/ssh.py +++ b/dvc/fs/ssh.py @@ -67,6 +67,7 @@ class SSHFileSystem(CallbackMixin, FSSpecWrapper): ) login_info["password"] = config.get("password") + login_info["passphrase"] = config.get("password") raw_keys = [] if config.get("keyfile"): diff --git a/tests/unit/fs/test_ssh.py b/tests/unit/fs/test_ssh.py index da5a544e6..a7372ddd6 100644 --- a/tests/unit/fs/test_ssh.py +++ b/tests/unit/fs/test_ssh.py @@ -34,10 +34,13 @@ def test_get_kwargs_from_urls(): def test_init(): - fs = SSHFileSystem(user="test", host="12.34.56.78", port="1234") + fs = SSHFileSystem( + user="test", host="12.34.56.78", port="1234", password="xxx" + ) assert fs.fs_args["username"] == "test" assert fs.fs_args["host"] == "12.34.56.78" assert fs.fs_args["port"] == "1234" + assert fs.fs_args["password"] == fs.fs_args["passphrase"] == "xxx" mock_ssh_config = """