skip to navigation
skip to content

advanced-ssh-config 1.1.0

Add some magic to SSH and .ssh/config

Advanced SSH config

|Travis| |PyPI version| |PyPI downloads| |License| ||

|ASSH logo - Advanced SSH Config logo|

Enhances ``ssh_config`` file capabilities

**NOTE**: This program is called by
`ProxyCommand <http:"" wiki="" openssh="" cookbook="" proxies_and_jump_hosts#proxycommand_with_netcat="">`__
from `lib-ssh <https:"">`__.


It works *transparently* with :

- ssh
- scp
- rsync
- git
- and even desktop applications depending on ``lib-ssh`` (for instance
`Tower <http:"">`__, ` <https:"">`__,
`SSH Tunnel Manager <http:"" fr="" stm=""/>`__)


The ``.ssh/config`` file is automatically generated, you need to update
``.ssh/config.advanced`` file instead; With new features and a better
regex engine for the hostnames.


.. code:: console

$ assh --help
Usage: assh [OPTIONS] COMMAND [arg...]

build Build .ssh/config based on .ssh/config.advanced
connect <host> Open a connection to <host>
info <host> Print connection informations
init Build a .ssh/config.advanced file based on .ssh/config
generate-etc-hosts Print a /etc/hosts file of .ssh/config.advanced
stats Print statistics

--version show program's version number and exit
-h, --help show this help message and exit
-p PORT, --port=PORT SSH port
ssh_config file
-f, --force
-v, --verbose
-l LOG_LEVEL, --log_level=LOG_LEVEL

Commmand line features

**Gateway chaining**

.. code:: bash


Connect to ```` using ssh and create a proxy on ```` to
````. Then connect to ```` using the created proxy on

.. code:: bash


Connect to ```` using ```` which itself uses

Configuration features

- **regex for hostnames**: ``*``
- **aliases**: ``gate`` -> ``gate.domain.tld``
- **gateways**: transparent ssh connections chaining
- **includes**: split configuration into multiple files, support
- **local command execution**: finally a way to execute a command
locally on connection
- **inheritance**: ``inherits = gate.domain.tld``
- **variable expansion**: ``User = $USER`` (take $USER from
- **smart proxycommand**: connect using ``netcat``, ``socat`` or custom

Config example


.. code:: ini

# Simple example
user = pacman
port = 2222

hostname =
gateways = # `ssh bar` will use `` as gateway

gateways = bar # `ssh will use `bar` as gateway which
# itself will use `` as gateway

ProxyCommand = assh --port=%p connect %h


.. code:: ini

# Complete example
user = pacman
port = 2222
hostname =

hostname =
gateways = foo
# By running `ssh bar`, you will ssh to `bar` through a `ssh foo`

IdentityFile = ~/.ssh/root-joe

gateways = direct
# Will try to ssh without proxy, then fallback to proxy, then
# fallback to through bar

DynamicForward = 43217
LocalForward = 1723 localhost:1723
ForwardX11 = yes

Includes = ~/.ssh/config.advanced2 ~/.ssh/config.advanced3 ~/.ssh/configs/*/host.config
# The `Includes` directive must be in the `[default]` section

Port = 22
User = root
IdentityFile = ~/.ssh/id_rsa
ProxyCommand = assh connect %h --port=%p
Gateways = direct
PubkeyAuthentication = yes
VisualHostKey = yes
ControlMaster = auto
ControlPath = ~/.ssh/controlmaster/%h-%p-%r.sock
EscapeChar = ~


Download the latest build

.. code:: console

$ curl -L`uname -s`-`uname -m` > /usr/local/bin/assh
$ chmod +x /usr/local/bin/assh

Using Pypi

.. code:: console

$ pip install advanced-ssh-config

Or by cloning

.. code:: console

$ git clone
$ cd advanced-ssh-config
$ make install

First run

Automatically generate a new ``.ssh/config.advanced`` based on your
current ``.ssh/config`` file:

.. code:: console

$ assh init > ~/.ssh/config.advanced
$ assh build -f


.. code:: console

$ make test



.. code:: console

$ docker build -t moul/advanced-ssh-config .


.. code:: console

$ docker run -rm -i -t moul/advanced-ssh-config
$ docker run -rm -i -t -v $(pwd)/:/advanced_ssh_config moul/advanced-ssh-config
$ docker run -rm -i -t -v moul/advanced-ssh-config python test


- `Christo DeLange <https:"" dldinternet="">`__


© 2009-2015 Manfred Touron - `MIT
License <https:"" moul="" advanced-ssh-config="" blob="" master="" license.txt="">`__.

.. |Travis| image::
.. |PyPI version| image::
.. |PyPI downloads| image::
.. |License| image::
.. || image::
.. |Gitter| image::
.. |ASSH logo - Advanced SSH Config logo| image::
File Type Py Version Uploaded on Size
advanced-ssh-config-1.1.0.macosx-10.10-intel.tar.gz (md5)
built for Darwin-14.4.0
"dumb" binary any 2015-07-22 37KB
advanced-ssh-config-1.1.0.tar.gz (md5) Source 2015-07-22 17KB
advanced_ssh_config-1.1.0-py2.6.egg (md5) Python Egg 2.6 2015-07-22 48KB
advanced_ssh_config-1.1.0-py2.7.egg (md5) Python Egg 2.7 2015-07-22 48KB
advanced_ssh_config-1.1.0-py26-none-any.whl (md5) Python Wheel 2.6 2015-07-22 24KB
advanced_ssh_config-1.1.0-py27-none-any.whl (md5) Python Wheel 2.7 2015-07-22 24KB