cloudmesh-configuration.cloudmesh.configuration.security.ssh_config

Managing ~/.ssh/config

Module Contents

Classes

ssh_config

Managing the config in .ssh

class cloudmesh-configuration.cloudmesh.configuration.security.ssh_config.ssh_config(filename=None)

Bases: object

Managing the config in .ssh

names(self)

The names defined in ~/.ssh/config :return: the names

load(self)

list the hosts defined in the ssh config file

list(self)

list the hosts in the config file :return:

__str__(self)

The string representing the config file :return: the string representation

abstract status(self)

executes a test with the given ssh config if a login is possible.

TODO: not yet implemented

login(self, name)

login to the host defines in .ssh/config by name :param name: the name of the host as defined in the config file :return:

execute(self, name, command)

execute the command on the named host :param name: the name of the host in config :param command: the command to be executed :return:

local(self, command)

execute the command on the localhost :param command: the command to execute :return:

username(self, host)

returns the username for a given host in the config file :param host: the hostname :return: the username

generate(self, key='india', host='india.futuresystems.org', username=None, force=False, verbose=False)

adds a host to the config file with given parameters.

Parameters
  • key – the key

  • host – the host

  • username – the username

  • force – not used

  • verbose – prints debug messages

Returns

cloudmesh-configuration.cloudmesh.configuration.security.ssh_config.hosts