Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SCP and StartShell behaves the same way as Device for SSH #649

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jan 13, 2017

  1. Do not provide the key if it comes from the SSH configuration

    This is a followup of Juniper#628 where this change was initially pushed but
    reverted because I didn't remember why I did it. Before Juniper#628, when an
    identity is provided in the SSH configuration, it was not copied in
    `_conf_ssh_private_key_file` due to a bug. After fixing the bug in Juniper#628,
    the key is now copied.
    
    However, the SSH configuration is provided to the `connect()` method
    which will use it if needed. Therefore, this is not needed. Moreover, if
    the key is provided by an agent and/or encrypted, this won't work as,
    later in the code, `allow_agent` will be set to `False` due to the
    presence of a private key.
    vincentbernat committed Jan 13, 2017
    Configuration menu
    Copy the full SHA
    51a68d1 View commit details
    Browse the repository at this point in the history
  2. scp: simplify SSH connection settings

    The `allow_agent` setting was used with NC but not with SCP. Store it in
    the device and reuse it for SCP.
    
    The private key was stored in a dictionnary, but this is not needed as
    Paramiko's `connect()` would default to `None` when not provided.
    
    Grab the SSH key filename from SSH configuration as Paramiko won't do it
    for us. For this reason, this commit is a followup to the one in Juniper#648.
    vincentbernat committed Jan 13, 2017
    Configuration menu
    Copy the full SHA
    a3686e6 View commit details
    Browse the repository at this point in the history
  3. scp: move paramiko SSH client creation into a dedicated function

    This is a preparation to reuse the client for other purposes, notably
    for starting a shell.
    vincentbernat committed Jan 13, 2017
    Configuration menu
    Copy the full SHA
    63ccdcc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    35d3390 View commit details
    Browse the repository at this point in the history