Exemplo n.º 1
0
def setupSecurity():
    """
    Set up SSH security ready for Vazels to play with.

    This should be run after any config setup as a module it imports defines a
    number of :mod:`config` defaults and it plays with the configuration itself.

    """

    # Imported here as it sets defaults.
    import security

    if not config.getSettings("security")["customkey"]:
        print "Creating new SSH key..."
        security.makeKey()

    print "Backing up and authorising custom key..."
    security.backup()
    security.authoriseKey()
    atexit.register(security.restore)
    print "Done."
Exemplo n.º 2
0
else:
    print "Config Loaded"

show_break()

# Security Setup

# Has to be imported after config is set up
import security

if not config.getSettings("security")["customkey"]:
    print "Creating new SSH key..."
    security.makeKey()

print "Backing up and authorising custom key..."
security.backup()
security.authoriseKey()
atexit.register(security.restore)
print "Done."

show_break()

# Pre-Server Launch Setup

import authentication

if new_config:
# Ask only if we're looking at a new file
    from getpass import getpass

    password = getpass("Please give a passkey for accessing the interface (Blank for none): ")