At 11:28 AM -0400 6/29/08, Stephen Bannasch wrote:
>I'm using capistrano 2.4.3
>
>I'd like to modify deploy.rb to have Net::SSH use the User value in
>.ssh/config if it exists so I don't need to specifically add my
>username to deploy.rb.
>
>My username on my local machine is 'stephen' however my username on
>most of the servers I deploy to is 'sbannasch'.

Here's the hack I am using now in deploy.rb to solve this problem:

# if SSH user defined in ~/.ssh/config use that name as the user
# otherwise use the user defined in ENV
set :user, File.open("#{ENV['HOME']}/.ssh/config", 'r') {|f| f.read}[/User 
(.*)/, 1] || ENV['USER']

--~--~---------~--~----~------------~-------~--~----~
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