Skip to content

Support encrypted (password-protected) SSH key files #3061

@MonkeeMan1

Description

@MonkeeMan1

I'm currently trying to use the dockerpy sdk to connect to my remote ubuntu server so i can manage my docker containers via python.

I am getting a few issues when attempting to do this.

docker.APIClient(base_url="ssh://user@ip")

When doing the following I am getting the error:

paramiko.ssh_exception.PasswordRequiredException: private key file is encrypted

I can resolve this issue by adding the kwarg: use_ssh_client, but then i am forced to input a password, which limits the potential for automation.

docker.APIClient(base_url="ssh://user:@ip", use_ssh_client=True)

When using the above code, I have also tried to enter my ssh key password into the base_url such as:

docker.APIClient(base_url="ssh://user:pass@ip", use_ssh_client=True)

However, this then greets me with the following error:

docker.errors.DockerException: Invalid bind address format: ssh://root:pass@ip

I have run out of ideas and am confused as to how I am supposed to get around this?

Many thanks in advance...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions