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

RFC: bash integration #37

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

Conversation

bendikro
Copy link

@bendikro bendikro commented Apr 3, 2017

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

bendikro added 5 commits May 29, 2017 14:50
SyntaxWarning: name 'print' is used prior to global declaration
* 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
Custom options to ssh can be specified through the
EXTRA_SSH_OPTIONS environment variable.
@bendikro bendikro force-pushed the develop_bash_integration branch from 0271539 to 46d6185 Compare May 29, 2017 13:06
bendikro added 2 commits August 6, 2019 23:26
Add options --disable-agent, --enable-agent to control whether
ssh-ident should load the agent configs for the current agent.

When disabled, the default ssh-agent settings will be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant