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

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

Uploaded Source

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

Uploaded Python 3

Supported by

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