Skip to main content

Load servers from a file, list, login, and SSH mount

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zensols.hostcon-0.5.0-py3.6.egg (13.9 kB view details)

Uploaded Egg

zensols.hostcon-0.5.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file zensols.hostcon-0.5.0-py3.6.egg.

File metadata

  • Download URL: zensols.hostcon-0.5.0-py3.6.egg
  • Upload date:
  • Size: 13.9 kB
  • Tags: Egg
  • Uploaded using 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

File hashes

Hashes for zensols.hostcon-0.5.0-py3.6.egg
Algorithm Hash digest
SHA256 0664dba629b8d7f328913697d762809a47afac55c30cc2da9f946718df7f11de
MD5 72ede10f02ece6b6d54e0e326fc73a1a
BLAKE2b-256 48828d1cf5ef096abe35f21b156d7c6265fd7abf4bdf068472ac3291c707ec98

See more details on using hashes here.

File details

Details for the file zensols.hostcon-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: zensols.hostcon-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for zensols.hostcon-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78e6caa117fa60d475857b7c32347661ec250c33018b7678b4a9109bcfef19fe
MD5 cba050784f3a42a6e274c4d3a76a8b90
BLAKE2b-256 77d6d2d2b1112642f2546a60c815f035f9f40e6efdb15d95da78d27dbc66e46f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page