how to use gateway with different user for one server

17 views
Skip to first unread message

jemminger

unread,
Jan 3, 2008, 7:26:21 PM1/3/08
to Capistrano
here's the problem: most of my roles (app, web) use the same user and
do not need a gateway. my db role however needs an ssh tunnel and a
different user, plus a public key.

here's what i have set up:

task :production do
ssh_options[:keys] = "#{current_path}/config/my-key"
set :gateway, 'my.gateway.com'
role :web, 'my.webserver.com'
role :app, 'my.appserver.com', :primary => true
role :db, "ro...@my.dbserver.com", :no_release => true, :primary =>
true
end

i keep getting the error:

* establishing connection to `ro...@my.dbserver.com' via gateway
Net::SSH::AuthenticationFailed: root
...
connection failed for: ro...@my.dbserver.com
(Capistrano::ConnectionError: could not establish connection to
`ro...@my.dbserver.com')

any ideas?

jemminger

unread,
Jan 4, 2008, 1:19:44 PM1/4/08
to Capistrano
Thought I'd mention that I can manually tunnel in to the db from the
gateway machine using:
ssh -i /path/to/config/my-key ro...@my.dbserver.com



On Jan 3, 7:26 pm, jemminger <jemmin...@gmail.com> wrote:
> here's the problem: most of my roles (app, web) use the same user and
> do not need a gateway. my db role however needs an ssh tunnel and a
> different user, plus a public key.
>
> here's what i have set up:
>
> task :production do
> ssh_options[:keys] = "#{current_path}/config/my-key"
> set :gateway, 'my.gateway.com'
> role :web, 'my.webserver.com'
> role :app, 'my.appserver.com', :primary => true
> role :db, "r...@my.dbserver.com", :no_release => true, :primary =>
> true
> end
>
> i keep getting the error:
>
> * establishing connection to `r...@my.dbserver.com' via gateway
> Net::SSH::AuthenticationFailed: root
> ...
> connection failed for: r...@my.dbserver.com
> (Capistrano::ConnectionError: could not establish connection to
> `r...@my.dbserver.com')
>
> any ideas?
Reply all
Reply to author
Forward
0 new messages