Now I realized that when I using command "cap deploy:setup"
it doesn't require password for Windows login user name but requires
root user password, not authorized public key.
Though it went well. I confirmed directories were made.
And comment out "set :scm, :git" for test, of course it couldn't
deploy well, but command finished and doesn't require password for
Windows login user name.
So, it seems that this problem occurs when using git, not Windows.
I found past similar problem.
http://www.mail-archive.com/capis...@googlegroups.com/msg05494.html
quote:
Both 'user' variables are set to 'rails-app-user' in deploy.rb:.
But Capistrano 2.5.3 keeps using my local username to log into the
server. [OS X Leopard, 10.5.5.]
This problem seems unsolved.
What should I do?
I re-installed Git (msysgit) "Use Plink" on Coosing SSH executable step.
Then, the problem which require password for Windows login user name fixed.
But ... access denied and got a fatal error.
Command prompt
---------------------------------------------------------------
>cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote
ssh://remote.host.address:22/var/git/project.git HEAD"
fatal: protocol error: bad line length character
Access denied
Access denied
Access denied
Access denied
Access denied
Access denied
FATAL ERROR: Server sent disconnect message
type 2 (protocol error):
"Too many authentication failures for "
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/project/releases/20090331074542; true"
** [deploy:update_code] exception while rolling back:
Capistrano::NoMatchingServersError, `deploy:update_code' is only run
for servers matching {:except=>{:no_release=>true}}, but no servers
matched
c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy/scm/git.rb:224:in
`query_revision': Unable to resolve revision for 'HEAD' on repository
'ssh://remote.host.address:22/var/git/si
s.git'. (RuntimeError)
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in
`send'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in
`method_missing'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy/scm/base.rb:63:in
`local'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in
`method_missing'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/recipes/deploy.rb:37:in
`load'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/variables.rb:87:in
`call'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/variables.rb:87:in
`fetch'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/variables.rb:110:in
`protect'
... 38 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/cli/execute.rb:14:in
`execute'
from c:/ruby/lib/ruby/gems/1.8/gems/capistrano-2.5.5/bin/cap:4
from c:/ruby/bin/cap:19:in `load'
from c:/ruby/bin/cap:19
---------------------------------------------------------------------------------
What's wrong?
Get the id_rsa.* files for your keys and copy them to /Documents and
Settings/<username>/.ssh
Be advised that there is no way to create a .ssh (watch the '.' at the
start) from windows explorer, you will have to open a command window and
use mkdir.
The key in you id_rsa.pub should be added to the authorized keys file of
your server.
I initially had a bit of trouble getting cap to see the keys so I had to
add a couple of lines in my capfile. Also because it's for work I use a
different pair of keys than privately so I renamed the _rsa files:
ssh_options[:paranoid] = false
if File.exists?("#{ENV["USERPROFILE"]}/.ssh/other_rsa")
ssh_options[:keys] = "#{ENV["USERPROFILE"]}/.ssh/other_rsa"
end
ssh_options[:forward_agent] = true
Cheers,
V.-
I fixed the problem which got a message "Access denied".
It was deploy.rb and pageant which caused.
I did below.
1.deploy.rb
set :repository, "ssh://remote.host.address:22/var/git/#{application}.git"
↓
set :repository,
"ssh://ro...@remote.host.address:22/var/git/#{application}.git" #add
"root@"
2.I found that pagent does not save SSH keys, so added keys.
Then SSH key required and "Access denied" didn't show.
But... I got an another error "ssh_exchange_identification".
Command prompt messages are below.
-----------------------------------------------------------------------------------
>cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote
ssh://ro...@remote.host.address:22/var/git/project.git HEAD"
* executing "git clone -q
ssh://ro...@remote.host.address:22/var/git/project.git
/var/www/project/releases/20090402055505 && cd
/var/www/project/releases/20090402055505 && git checkout -q -b deploy
82594de76a1b6c43505
2a678e4aa13f52d93084a && rm -Rf
/var/www/project/releases/20090402055505/.git && (echo
82594de76a1b6c435052a678e4aa13f52d93084a >
/var/www/project/releases/20090402055505/REVISION)"
servers: ["remote.host.address"]
[remote.host.address] executing command
** [remote.host.address :: out] ssh_exchange_identification:
Connection closed by remote host #<This is the ploblem.
** [remote.host.address :: out] fatal: The remote end hung up unexpectedly
command finished
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/project/releases/20090402055505; true"
servers: ["remote.host.address"]
[remote.host.address] executing command
command finished
failed: "sh -c \"git clone -q
ssh://ro...@remote.host.address:22/var/git/project.git
/var/www/project/releases/20090402055505 && cd
/var/www/project/releases/20090402055505 && git checkout -q -b deploy
82594de76a1b6c435
052a678e4aa13f52d93084a && rm -Rf
/var/www/project/releases/20090402055505/.git && (echo
82594de76a1b6c435052a678e4aa13f52d93084a >
/var/www/project/releases/20090402055505/REVISION)\"" on
remote.host.address
-----------------------------------------------------------------------------------
It seemed to be concerned "/ect/hosts.allow" file,so I added my IP
addres for /ect/hosts.allow, but nothing changed.
Execute "git push origin master" finished without error, so git seems
to be authenticated fine.