ssh-ident
ssh-ident copied to clipboard
RFC: bash integration
This is more of an request for comments than a ready-to-be-merged PR.
This implements parts of the functionality described in #22 (A command line interface for selecting identity and listing identities and keys).
From the commit message:
Add improved bash support and ssh_ident_cli.py CLI script
* Add setting per-shell ssh identity
Support changing the active ssh identity by using bash functions
to set the SSH_IDENT variable for the shell.
* Hostname completion
Add support for hostname completion with the currently active ssh
identity by adding a wrapper script for ssh bash completion that
sets the config as a command line option.
* Add config option to define bash functions that overload
ssh, scp, sftp, and rsync commands
* Add tox.ini and fix some pep8 warnings
To test with a develop install:
mkdir ~/ssh-ident-install
export PYTHONPATH=~/ssh-ident-install
python setup.py develop --install-dir=~/ssh-ident-install --symlinks
In .bashrc
SSH_IDENT_INSTALL_PATH="~/ssh-ident-install"
export PATH=$PATH:$SSH_IDENT_INSTALL_PATH
source ${SSH_IDENT_INSTALL_PATH}/ssh_ident.sh
To activate in a shell, execute:
ssh_ident_activate
and the active ssh identity should be displayed in the prompt.
Change identity with:
ssh_ident -s <identity>
List identities:
ssh_ident -l
Deactivate with
ssh_ident_deactivate
Note: The current bash-completion script depends on ssh bash completion to be available at
/usr/share/bash-completion/completions/ssh