braintree / runbook

A framework for gradual system automation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What username is used for ssh?

pitosalas opened this issue · comments

Even though my runbook says user rails it seems that when the ssh is done it uses my own login name on the controlling computer. I am missing something simple.

#!/usr/bin/env ruby
require "runbook"

runbook = Runbook.book "My First" do
  description "Playing"

  section "SECTION" do
    server "165.227.126.51"
    user "root"
    step "$ ls" do
      note "doing an ls"
      command "ls -la"
    end
  end
end

if __FILE__ == $0
  Runbook::Runner.new(runbook).run
else
  runbook
end

/Users/pitosalas/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:263:in start': Authentication failed for user pitosalas@16.22.12.5 (Net::SSH::AuthenticationFailed)`

p.s. is there a user forum where I should ask this or do you want questions here?

@pitosalas Asking questions here is fine. The user declaration determines what user you will sudo as once connected to the host. When connecting to the host, your current user will be used unless you specify user@ in the host string. More details here: https://github.com/braintree/runbook#remote-command-execution