From 713345918eb496fe0d537f0ebe5d5637e1fe64cc Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Fri, 26 Jan 2018 11:20:14 +0200 Subject: [PATCH] ssh: document sub-shell mode --- doc/README-SSH.md | 3 +++ libagent/ssh/__init__.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/README-SSH.md b/doc/README-SSH.md index 95fed37..b1d5106 100644 --- a/doc/README-SSH.md +++ b/doc/README-SSH.md @@ -4,6 +4,9 @@ [![Demo](https://asciinema.org/a/22959.png)](https://asciinema.org/a/22959) ## Advanced usage (multiple SSH sessions from a sub-shell) +This feature allows using regular SSH-related commands within a subprocess running user's shell. +`SSH_AUTH_SOCK` environment variable is defined for the subprocess (pointing to the SSH agent, running as a parent process). +This way the user can use SSH-related commands (e.g. `ssh`, `ssh-add`, `sshfs`, `git`, `hg`), while authenticating via the hardware device. [![Subshell](https://asciinema.org/a/33240.png)](https://asciinema.org/a/33240) ## Loading multiple SSH identities from configuration file diff --git a/libagent/ssh/__init__.py b/libagent/ssh/__init__.py index a603146..2411307 100644 --- a/libagent/ssh/__init__.py +++ b/libagent/ssh/__init__.py @@ -81,7 +81,8 @@ def create_agent_parser(device_type): g = p.add_mutually_exclusive_group() g.add_argument('-s', '--shell', default=False, action='store_true', - help='run ${SHELL} as subprocess under SSH agent') + help=('run ${SHELL} as subprocess under SSH agent, allowing ' + 'regular SSH-based tools to be used in the shell')) g.add_argument('-c', '--connect', default=False, action='store_true', help='connect to specified host via SSH') g.add_argument('--mosh', default=False, action='store_true',