Skip to main content

Simple program to connect to servers from a list.

Travis CI Build Status

This is a simple program to load servers from a file, list them, then allow you to login, SSH mount, etc.

Features provided by a terse command line syntax:

  • Login using a terminal instance on the command line via SSH.
  • Invoke an xterm on a configured host.
  • Mount and unmount a SSH Fuse directory.
  • Invoke a Emacs session via SSH.
  • Print environment in a bash export format for scripting.
  • Output a bourne shell script that does what the script would do for a particular environment (per -n option).

Other commands are easily configurable in cli.py.

Obtaining

The easist way to install the command line program is via the pip installer:

pip install zensols.hostcon

Binaries are also available on pypi.

Usage

First, create a configuration file. Examples used by the test cases are given here. Below is a simple example that declares an SSH host jove on the (default) port 22 with SSH Fuse mount options convenient for a MacOS client.

[default]
host_name=jove
ssh_port=22
ssh_switches=-X -Y
mount_options=reconnect,sshfs_sync,no_readahead,sync_read,cache=no,noreadahead,noubc,noappledouble,noapplexattr

Save this example to ~/.hostconrc or anywhere else specified in environment variable HOSTCONRC. Now we can get include this as environment:

$ hostcon env
export DOMAIN=None
export HOST_NAME=jove
export SSH_PORT=22
export USER_NAME=someuser

Start an XTerm on the host:

$ hostcon
invoking ssh -X -Y -f -p 22 someuser@jove /usr/bin/xterm

See the test cases for more examples of how to configure and alias host information.

Help

The usage is given with -h:

$ hostcon -h
Usage: hostcon <list|...> [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s, --short           short output for list
  -w NUMBER, --whine=NUMBER
                        add verbosity to logging
  -n HOST_NAME, --hostname=HOST_NAME
                        the host to connect to
  -d, --dryrun          dry run to not actually connect, but act like it

Changelog

An extensive changelog is available here.

License

Copyright © 2018 Paul Landes

Apache License version 2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Metadata

Release files for zensols.hostcon 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for zensols.hostcon 0.5.0
File Interpreter ABI Platform
zensols.hostcon-0.5.0-py3.6.egg Legacy Egg format - - Details
zensols.hostcon-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 kB

Release files / zensols.hostcon-0.5.0-py3.6.egg

Download URL zensols.hostcon-0.5.0-py3.6.egg
Size 13.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
0664dba629b8d7f328913697d762809a47afac55c30cc2da9f946718df7f11de
BLAKE2b-256 checksum
How to use checksums
48828d1cf5ef096abe35f21b156d7c6265fd7abf4bdf068472ac3291c707ec98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.3

Release files / zensols.hostcon-0.5.0-py3-none-any.whl

Download URL zensols.hostcon-0.5.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78e6caa117fa60d475857b7c32347661ec250c33018b7678b4a9109bcfef19fe
BLAKE2b-256 checksum
How to use checksums
77d6d2d2b1112642f2546a60c815f035f9f40e6efdb15d95da78d27dbc66e46f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4

2 release files

0.3

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page