AppController/djinn.rb
# Logs into the named host and alters its ssh configuration to enable the
# root user to directly log in.
Logs into the named host and alters its ssh configuration to enable the
root user to directly log in.
Logs into the named host and alters its ssh configuration to enable the root user to directly log in .
def enable_root_login(ip, ssh_key, user_name)
    options = '-o StrictHostkeyChecking=no -o NumberOfPasswordPrompts=0'
    backup_keys = 'sudo cp -p /root/.ssh/authorized_keys ' +
        '/root/.ssh/authorized_keys.old'
    Djinn.log_run("ssh -i #{ssh_key} #{options} 2>&1 #{user_name}@#{ip} " +
                      "'#{backup_keys}'")
    merge_keys = 'sudo sed -n ' +
        '"/Please login/d; w/root/.ssh/authorized_keys" ' +
        "~#{user_name}/.ssh/authorized_keys /root/.ssh/authorized_keys.old"
    Djinn.log_run("ssh -i #{ssh_key} #{options} 2>&1 #{user_name}@#{ip} " +
                      "'#{merge_keys}'")
  end
def enable_root_login ( ip , ssh_key , user_name ) options = '-o StrictHostkeyChecking=no -o NumberOfPasswordPrompts=0' backup_keys = 'sudo cp -p /root/.ssh/authorized_keys ' + '/root/.ssh/authorized_keys.old' Djinn . log_run ( "ssh -i #{ssh_key} #{options} 2>&1 #{user_name}@#{ip} " + "'#{backup_keys}'" ) merge_keys = 'sudo sed -n ' + '"/Please login/d; w/root/.ssh/authorized_keys" ' + "~#{user_name}/.ssh/authorized_keys /root/.ssh/authorized_keys.old" Djinn . log_run ( "ssh -i #{ssh_key} #{options} 2>&1 #{user_name}@#{ip} " + "'#{merge_keys}'" ) end
Logs into the named host and alters its ssh configuration to enable the
root user to directly log in.
Logs into the named host and alters its ssh configuration to enable the root user to directly log in .
ip
<not_specific>
ssh_key
<not_specific>
user_name
<not_specific>