Capistrano SSH::AuthenticationFailed, not prompting for password

后端 未结 9 1158
既然无缘
既然无缘 2020-12-07 22:41

I\'ve been using capistrano successfully for a while now and all of a sudden in every project I\'ve lost the ability to deploy.

Environment:

  • os X (Mave
相关标签:
9条回答
  • 2020-12-07 22:48

    I have a workaround that doesn't require downgrading net-ssh, per a comment at the link that Zach Lipton posted. Place this code in config/deploy.rb:

    set :ssh_options, {
      config: false
      #Other options...
    }
    

    After I did that, I got another error, Error reading response length from authentication socket. Found the solution to that here. Execute these commands at your Bash prompt:

    $ eval $(ssh-agent)
    $ ssh-add
    
    0 讨论(0)
  • 2020-12-07 22:51

    Figured it out! Apparently this issue was with net-ssh gem. I had version 2.8.0 installed recently with some updates to my development environment and was the cause.

    I'm not sure why it was failing, but gem uninstall net-ssh -v 2.8.0< fixed it for me.

    If anyone actually knows why this was an issue or how I can correct this issue with the newer version of net-ssh I'd be interested to hear it.

    0 讨论(0)
  • 2020-12-07 22:52

    The answer may break your rails app due to gem dependancies.

    The issue is with net-ssh as was correctly answered by Sparkmasterflex, however whilst this will get capistrano working ok it may break your rails app:

    These steps fixed both capistrano and rails for me ...

    1. In your Gemfile add gem 'net-ssh', '2.7.0'
    2. Run bundle update net-ssh
    3. Run bundle (just to be sure everything is working ok'
    4. Run gem uninstall net-ssh -v 2.8.0

    If you are a rails user you should now be able to run both the rails server and capistrano.

    0 讨论(0)
  • 2020-12-07 22:52

    This snippet works for me:

    group :development do
      #.....
      gem 'capistrano', "~> 2.15"
      gem "net-ssh", "~> 2.7.0"
      #.....
    end
    
    0 讨论(0)
  • 2020-12-07 23:00
    set :ssh_options, {
     verbose: :debug
    }
    

    ... helps a lot!

    I had an issue that I generated my public and private keys with puttygen and exported private key as OpenSSH with name <somename>.id_rsa. An then saved public key with name <somename>.id_rsa.pub.

    ( ! ) The public key puttygen saves is in RFC 4716 format not PEM. Use public suffix instead of pub for public key file-

    0 讨论(0)
  • 2020-12-07 23:03

    Upgrading your net-ssh version to 2.8.1 will solve the problem. They released a version bump in 19th february 2014 that fix this and other problems.

    1. Uninstall your current net-ssh gem (gem install net-ssh -v 'version')
    2. Just paste this on your Gemfile:

      gem 'net-ssh', '~> 2.8.1', :git => "https://github.com/net-ssh/net-ssh"

    3. Run bundle install

    0 讨论(0)
提交回复
热议问题