On Tue, Mar 9, 2010 at 3:30 PM, Jeremy Frens <[email protected]> wrote:
> Is using ssh keys out of the question?  Create a ssh key on the

ssh key is not out of question. I can ssh from gateway to remote host with a key

(iqbala)@gateway:~$ id
uid=2505(iqbala) gid=15(users)

I can ssh from gateway to my host scrub with key just fine

(iqbala)@gateway:~$ ssh scrub
Last login: Tue Mar  9 17:50:58 2010 from jp-script.arl.q
-bash-4.0$ id
uid=101(iqbala) gid=10(staff)

I am running capistrano from this machine

iqb...@ghar-iqbala:~$ id
uid=1000(iqbala) gid=1000(iqbala) groups=4(adm)

iqb...@ghar-iqbala:~$ cat capfile
set :gateway, "gateway.example.net"
role :myhosts, *File.open("hosts").map { |host| host }
task :uname, :roles => :myhosts do
  run "uname -a"
end

iqb...@ghar-iqbala:~$ cap shell
  * executing `shell'
====================================================================
Welcome to the interactive Capistrano shell! This is an experimental
feature, and is liable to change in future releases. Type 'help' for
a summary of how to use the shell.
--------------------------------------------------------------------
cap> uname
[establishing connection(s) to scrub.example.net]
Password: (this is the prompt to login to gateway host)
connection failed for: scrub.example.net
(Net::SSH::AuthenticationFailed: iqbala)

so even though I can ssh from gateway to remote host w/ ssh key, but
when coming in using
capistrano it fails. The only way I can get into remote host thru capistrano is
by changing my password on remote host to match my gateway host.

I will try your second option with ssh agent


> machine you deploy from, and put the public key on both the gateway
> and deployment machines.  Then if you forward your agent (I have
> "ForwardAgent yes" in my ~/.ssh/config file), then the secret key on
> your machine will be used on the gateway and deployment machines.
>
> jdf
>
> On Mon, Mar 8, 2010 at 9:47 PM, Asif Iqbal <[email protected]> wrote:
>> How do I use gateway host to connect to hosts
>> when my credentials (password) on gateway host is different from
>> hosts ?
>>
>> Here is my simple capfile
>>
>> set :gateway, "gw.example.net"
>> role :myhosts, *File.open("hosts").map { |host| host }
>> task :uname, :roles => :myhosts do
>>  run "uname -a"
>> end
>> task :puppet, :roles => :myhosts do
>>  run "ps -ef | grep puppetd"
>> end
>>
>> I get only prompted for login to gateway and that credential is being
>> tried to access the hosts.
>>
>> Thanks for any help.
>>
>> --
>> Asif Iqbal
>> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
>> A: Because it messes up the order in which people normally read text.
>> Q: Why is top-posting such a bad thing?
>>
>> --
>> * You received this message because you are subscribed to the Google Groups 
>> "Capistrano" group.
>> * To post to this group, send email to [email protected]
>> * To unsubscribe from this group, send email to 
>> [email protected] For more options, visit this group 
>> at http://groups.google.com/group/capistrano?hl=en
>
>
>
> --
> Jeremy D. Frens
> [email protected]
> http://www.norecess.org/
>
> --
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to