Sudden cache deployment indicates authentication error

I have been using Symfony2 application without problems for several weeks using Capifony. The other day, I run a cap and nothing works. I did not change any keys or, in vain, changed any other settings.

I am deploying bitbucket from my repository.

I checked access rights and property rights everywhere.

/ var / git /. ssh / authorized_keys permissions 600 git users

/ var / git /. ssh / known_hosts permissions 640 user git

/ var / git /. ssh / config permissions of 700 git users:

Host bitbucket.org
 Hostname bitbucket.org
 ForwardAgent yes
 ForwardX11 no
 User git
 IdentityFile /var/git/.ssh/bitbucket_rsa

I can log in with the same public key on the bitpack from my local machine to the production server. I tried another key.

ruby ​​(1.9.3). Capifony 2.4.2 (2.4.0 Capistrano 2.15.5).

.

deploy.rb:

set :repository,  "git@bitbucket.org:username/example.git"
set :scm,         :git

ssh_options[:forward_agent] = true
ssh_options[:verbose] = :debug
ssh_options[:keys] = %w(/var/git/.ssh/bitbucket_rsa)

:

* ←[32m2014-02-04 09:20:30 executing `deploy:check'←[0m
* ←[33mexecuting "test -d /var/www/vhosts/example.com/releases"←[0m
servers: ["example.com"] D, 
[2014-02-04T09:20:30.140652 #11708] DEBUG -- net.ssh.transport.session[15bfe8c]: 
establishing connection to example.com:22
D, [2014-02-04T09:20:30.320662 #11708] DEBUG -- net.ssh.transport.session[15bfe8c]:
connection established
I, [2014-02-04T09:20:30.320662 #11708]  INFO -- net.ssh.transport.server_version 
[15bf274]: negotiating protocol version
D, [2014-02-04T09:20:30.469671 #11708] DEBUG -- net.ssh.transport.server_version
[15bf274]: remote is `SSH-2.0-OpenSSH_5.3'
D, [2014-02-04T09:20:30.470671 #11708] DEBUG -- net.ssh.transport.server_version
[15bf274]: local is `SSH-2.0-Ruby/Net::SSH_2.8.0 i386-mingw32'
D, [2014-02-04T09:20:30.530674 #11708] DEBUG -- tcpsocket[15bfb5c]: read 784 bytes
D, [2014-02-04T09:20:30.530674 #11708] DEBUG -- tcpsocket[15bfb5c]: received packet nr 
0 type 20 len 780
I, [2014-02-04T09:20:30.530674 #11708]  INFO -- net.ssh.transport.algorithms[15bb0b0]: 
got KEXINIT from server
I, [2014-02-04T09:20:30.530674 #11708]  INFO -- net.ssh.transport.algorithms[15bb0b0]: 
sending KEXINIT
D, [2014-02-04T09:20:30.531675 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
0 type 20 len 1620
D, [2014-02-04T09:20:30.531675 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 1624 bytes
I, [2014-02-04T09:20:30.531675 #11708]  INFO -- net.ssh.transport.algorithms[15bb0b0]: 
negotiating algorithms
D, [2014-02-04T09:20:30.531675 #11708] DEBUG -- net.ssh.transport.algorithms[15bb0b0]: 
negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2014-02-04T09:20:30.532675 #11708] DEBUG -- net.ssh.transport.algorithms[15bb0b0]: 
exchanging keys
D, [2014-02-04T09:20:30.532675 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
1 type 34 len 20
D, [2014-02-04T09:20:30.532675 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 24 bytes
D, [2014-02-04T09:20:30.652681 #11708] DEBUG -- tcpsocket[15bfb5c]: read 152 bytes
D, [2014-02-04T09:20:30.652681 #11708] DEBUG -- tcpsocket[15bfb5c]: received 
packet nr 1 type 31 len 148
D, [2014-02-04T09:20:31.893752 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
2 type 32 len 140
D, [2014-02-04T09:20:31.893752 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 144 bytes
D, [2014-02-04T09:20:31.964757 #11708] DEBUG -- tcpsocket[15bfb5c]: read 720 bytes
D, [2014-02-04T09:20:31.964757 #11708] DEBUG -- tcpsocket[15bfb5c]: received packet nr 
2 type 33 len 700
D, [2014-02-04T09:20:31.968757 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
3 type 21 len 20
D, [2014-02-04T09:20:31.968757 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 24 bytes
D, [2014-02-04T09:20:31.968757 #11708] DEBUG -- tcpsocket[15bfb5c]: received packet nr 
3 type 21 len 12
D, [2014-02-04T09:20:31.969757 #11708] DEBUG -- 
net.ssh.authentication.session[15647f4]: beginning authentication of `git'
D, [2014-02-04T09:20:31.969757 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
4 type 5 len 28
D, [2014-02-04T09:20:31.969757 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 52 bytes
D, [2014-02-04T09:20:32.129766 #11708] DEBUG -- tcpsocket[15bfb5c]: read 52 bytes
D, [2014-02-04T09:20:32.129766 #11708] DEBUG -- tcpsocket[15bfb5c]: received packet nr 
4 type 6 len 28
D, [2014-02-04T09:20:32.129766 #11708] DEBUG -- 
net.ssh.authentication.session[15647f4]: trying none
D, [2014-02-04T09:20:32.130766 #11708] DEBUG -- tcpsocket[15bfb5c]: queueing packet nr 
5 type 50 len 44
D, [2014-02-04T09:20:32.130766 #11708] DEBUG -- tcpsocket[15bfb5c]: sent 68 bytes
D, [2014-02-04T09:20:32.290775 #11708] DEBUG -- tcpsocket[15bfb5c]: read 84 bytes
D, [2014-02-04T09:20:32.290775 #11708] DEBUG -- tcpsocket[15bfb5c]: received packet nr 
5 type 51 len 60
D, [2014-02-04T09:20:32.290775 #11708] DEBUG --     
net.ssh.authentication.session[15647f4]: allowed methods: publickey,gssapi-
keyex,gssapi-with-mic,password
D, [2014-02-04T09:20:32.291775 #11708] DEBUG --     
net.ssh.authentication.methods.none[156bb14]: none failed
D, [2014-02-04T09:20:32.291775 #11708] DEBUG -- 
net.ssh.authentication.session[15647f4]: trying publickey
D, [2014-02-04T09:20:32.291775 #11708] DEBUG -- net.ssh.authentication.agent[15a9f68]: 
connecting to ssh-agent
E, [2014-02-04T09:20:32.292775 #11708] ERROR -- net.ssh.authentication.agent[15a9f68]: 
could not connect to ssh-agent
D, [2014-02-04T09:20:32.292775 #11708] DEBUG -- 
net.ssh.authentication.session[15647f4]: trying password
E, [2014-02-04T09:20:32.292775 #11708] ERROR -- 
net.ssh.authentication.session[15647f4]: all authorization methods failed (tried none, 
publickey, password)
connection failed for: example.com (Net::SSH::AuthenticationFailed: Authentication 
failed for user git@example.com)

? , .

.

+4
3

, forward_agent, :

ssh-agent Bitbucket . , , , ,

: https://confluence.atlassian.com/display/BITBUCKET/Troubleshoot+SSH+Issues

ssh_options [: keys] =% w (/var/ git/. ssh/bitbucket_rsa) id_rsa, _rsa.

+1

capistrano/capifony (, net_ssh) .

...

ssh_options[:forward_agent] = true

...

ssh_options[:use_agent] = false

( , ssh ) ... , . :

ssh_options[:keys] = %w(/var/git/.ssh/bitbucket_rsa)
+3

. , .

 >> gem uninstall net-ssh -v 2.8.0
 >> gem install net-ssh -v 2.7.0

and now, when I call the methods "cap", it works fine and asks for a password.

+3
source

Source: https://habr.com/ru/post/1525265/


All Articles