cloudmesh-common.cloudmesh.common.ssh.ssh_config

Managing ~/.ssh/config

Module Contents

Classes

ssh_config

Managing the config in .ssh

class cloudmesh-common.cloudmesh.common.ssh.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

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

static delete(name)
generate(self, host='india', hostname='india.futuresystems.org', identity='~/.ssh/id_rsa.pub', user=None, force=False, verbose=False)

adds a host to the config file with given parameters. #TODO: make sure this is better documented :param key: the key :param host: the host :param username: the username :param force: not used :param verbose: prints debug messages :return: