hostcmd

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

The host sub-system allows you to manage connections to remote Geneos servers.

The geneos program can seamlessly manage Geneos instances transparently and securely by connecting to other Linux systems running Geneos components. You can do all the same things as with other Geneos instance that you have created locally.

This can be as simple at:

geneos add host myServer2
geneos add gateway Gateway2@myServer2
geneos start -H myServer2

Almost any command that accepts names to match instances can handle names like name@host.

Commands like ls and ps will works transparently and merge all instances together, showing you where they are configured to run.

The host name, as opposed to hostname, that you use when you add a host to geneos does not have to be the same as the underlying hostname of the remote server.

Adding Hosts

Currently only the SSH protocol is supported.

The recommended way to ensure secure connectivity is to use and agent with SSH keys. If this is not available then you can also use locally stored, unprotected (as in without a passphrase) private keys and finally locally stored encrypted passwords.

Future releases may add support for protected private keys (through the local encrypted storage of passphrases) or for Kerberos (GSS-API) authentication.

Please note that any configuration in your ssh_config file(s) is ignored. Also, you must have already added the remote SSH server key to your known_hosts file or connections will fail with an error.

When you add a host you must use either a local label (HOST in the examples and documentation) and/or an SSH URL that refers to the connection details and the remote location of the Geneos installation. The HOST is taken from the label, if given, or else the HOSTNAME part of the SSH URL.

The standard SSH URL has been extended to support the Geneos installation directory and for the add host command it looks like:

ssh://[USER@]HOSTNAME[:PORT][/PATH]

If not set, USER defaults to your current username. Similarly PORT defaults to 22. PATH defaults to the local Geneos installation path. The most basic SSH URL of the form ssh://hostname results in access as the current user on the default SSH port and rooted in the same directory as the local set-up. Is the remote directory is empty (dot files are ignored) then the standard file layout is created.

HOSTNAME can be an IP address, as can the HOST label but this is not recommended.

geneos host add server1 ssh://myserver.example.com

Prerequisites

There are other prerequisites for remote support:

  • Remote hosts must be Linux

  • The remote user must be configured to use a bash shell or similar. See limitations below.

If you can log in to a remote Linux server using ssh user@server and not be prompted for a password or passphrase then you are set to go. It's beyond the scope of this README to explain how to set-up ssh-agent or how to create an unprotected private key file, so please take a look online.

Limitations

The remote connections over SSH mean there are limitations to the features available on remote servers:

  • Control over instance processes is done via shell commands and little error checking is done, so it is possible to cause damage and/or processes not to to start or stop as expected.

  • All actions are taken as the user given in the SSH URL (which should NEVER be root) and so instances that are meant to run as other users cannot be controlled. Files and directories may not be available if the user does not have suitable permissions.

Documentation

Overview

Package hostcmd contains all the host subsystem commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKeyFiles

type PrivateKeyFiles []string

func (*PrivateKeyFiles) Set

func (i *PrivateKeyFiles) Set(value string) error

func (*PrivateKeyFiles) String

func (i *PrivateKeyFiles) String() string

func (*PrivateKeyFiles) Type

func (i *PrivateKeyFiles) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL