Ruby Net :: SSH :: AuthenticationFailed:用户root @ xxxxxxxxx的身份验证失败

时间:2018-08-31 10:51:12

标签: ruby ssh

我正在尝试通过Rails控制台SSH到另一台服务器,但是,出现以下错误。我几乎可以尝试所有可以在网上找到但仍然遇到相同错误的建议。我可以使用SSH顺利登录ssh root@xxx.x.xxx.x服务器。

    Net::SSH.start("xxx.xx.xx.x","root",:keys=> ["ssh-rsa ........"], :verbose => Logger::DEBUG) do |ssh| 
       puts ssh
    end


D, [2018-08-31T09:25:57.604405 #30930] DEBUG -- socket[3fcf45daf8a0]: queueing packet nr 3 type 5 len 28
D, [2018-08-31T09:25:57.604540 #30930] DEBUG -- socket[3fcf45daf8a0]: sent 52 bytes
D, [2018-08-31T09:25:57.643325 #30930] DEBUG -- socket[3fcf45daf8a0]: read 52 bytes
D, [2018-08-31T09:25:57.643674 #30930] DEBUG -- socket[3fcf45daf8a0]: received packet nr 3 type 6 len 28
D, [2018-08-31T09:25:57.643897 #30930] DEBUG -- net.ssh.authentication.session[3fcf4c354a20]: trying none
D, [2018-08-31T09:25:57.644151 #30930] DEBUG -- socket[3fcf45daf8a0]: queueing packet nr 4 type 50 len 44
D, [2018-08-31T09:25:57.644285 #30930] DEBUG -- socket[3fcf45daf8a0]: sent 68 bytes
D, [2018-08-31T09:25:57.646320 #30930] DEBUG -- socket[3fcf45daf8a0]: read 52 bytes
D, [2018-08-31T09:25:57.646501 #30930] DEBUG -- socket[3fcf45daf8a0]: received packet nr 4 type 51 len 28
D, [2018-08-31T09:25:57.646664 #30930] DEBUG -- net.ssh.authentication.session[3fcf4c354a20]: allowed methods: publickey
D, [2018-08-31T09:25:57.646807 #30930] DEBUG -- net.ssh.authentication.methods.none[3fcf4c341718]: none failed
D, [2018-08-31T09:25:57.646918 #30930] DEBUG -- net.ssh.authentication.session[3fcf4c354a20]: trying publickey
D, [2018-08-31T09:25:57.647084 #30930] DEBUG -- net.ssh.authentication.agent[3fcf4c32ebf4]: connecting to ssh-agent
E, [2018-08-31T09:25:57.647262 #30930] ERROR -- net.ssh.authentication.agent[3fcf4c32ebf4]: could not connect to ssh-agent: Permission denied - connect(2) for /tmp/ssh-LmmHflAUE4b4/agent.28067
E, [2018-08-31T09:25:57.647375 #30930] ERROR -- net.ssh.authentication.session[3fcf4c354a20]: all authorization methods failed (tried none, publickey)
Net::SSH::AuthenticationFailed: Authentication failed for user root@xxx.xx.xx.x
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/net-ssh-5.0.1/lib/net/ssh.rb:259:in `start'
    from (irb):2
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/console.rb:110:in `start'
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/console.rb:9:in `start'
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:14:in `require'
    from bin/rails:14:in `<main>'

1 个答案:

答案 0 :(得分:0)

好吧,所以它与库/密钥或def update(self, surface) self.data=surface.get_buffer().raw self.image=QtGui.QImage(self.data,w,h,QtGui.QImage.Format_RGB32) 本身无关,我正在尝试从SSH进行此操作,在同一服务器上从gitlab-rails c可以正常工作。