Sometimes I need to perform some tasks on a server as root
authenticated with public key, then right after that perform some
other tasks as a normal logged in user with a password.

I've been doing this successfully with Capistrano 2.2, but something
changed in Capistrano 2.3 that breaks this code:

set :password, '1234'
set :user, 'root'
set :ssh_options, ssh_options.merge({:keys => [key_path]})
sessions.clear

# do root stuff

set :ssh_options, ssh_options.merge({:keys => nil})
set :user, 'bob'
self.sessions.clear

# do regular user stuff

This was running great in 2.2, but under 2.3 I get the following error
when trying to run the 'regular user stuff':
connection failed for: hostname (Net::SSH::AuthenticationFailed: root)

>From the error I see it is trying to connect as root, but I'm not sure
why. I've done a diff of the source between 2.2 and 2.3 and nothing
stands out as an explanation.

Any help/hints are greatly appreciated!

Cheers,
-pete
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to