# NET:SSH fails authentification with :keys - ssh works

**URL:** <https://www.ruby-forum.com/t/net-ssh-fails-authentification-with-keys-ssh-works/183774>\
**Category:** Ruby\
**Created:** [February 19, 2010, 8:47pm UTC](https://www.ruby-forum.com/t/net-ssh-fails-authentification-with-keys-ssh-works/183774 "2010-02-19T20:47:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![psychomachine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9bd4f/32.png) [@psychomachine](https://www.ruby-forum.com/u/psychomachine)\
**Post date:** [February 19, 2010, 8:47pm UTC](https://www.ruby-forum.com/t/net-ssh-fails-authentification-with-keys-ssh-works/183774/1 "2010-02-19T20:47:22Z")

</div>

hi,

i can’t get my head around this:

Net::SSH.start(“[url.i.need.com](http://url.i.need.com)”, ‘root’, :keys =\> [“/path/to/keyfile”],  
:verbose =\> Logger::DEBUG ) do |ssh|  
ssh.exec!(“mount /persistent”)  
end

gives me failed authetification and

E, [2010-02-19T20:38:31.198582 #1494] ERROR –  
net.ssh.authentication.session[80c6f360]: all authorization methods  
failed (tried publickey, hostbased, password, keyboard-interactive)

but i can easily do

ssh -i /path/to/keyfile removed\_email\_address@domain.invalid

and i log in without a glitch.

any idea what could be going wrong here? many thanks in advance.

tench

---

<div class="post-metadata">

**Author:** ![psychomachine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9bd4f/32.png) [@psychomachine](https://www.ruby-forum.com/u/psychomachine)\
**Post date:** [April 23, 2010, 2:11am UTC](https://www.ruby-forum.com/t/net-ssh-fails-authentification-with-keys-ssh-works/183774/2 "2010-04-23T02:11:14Z")

</div>

Tench Johnson wrote:

> hi,
> 
> i can’t get my head around this:
> 
> Net::SSH.start(“[url.i.need.com](http://url.i.need.com)”, ‘root’, :keys =\> [“/path/to/keyfile”],  
> :verbose =\> Logger::DEBUG ) do |ssh|  
> ssh.exec!(“mount /persistent”)  
> end
> 
> gives me failed authetification and
> 
> E, [2010-02-19T20:38:31.198582 #1494] ERROR –  
> net.ssh.authentication.session[80c6f360]: all authorization methods  
> failed (tried publickey, hostbased, password, keyboard-interactive)
> 
> but i can easily do
> 
> ssh -i /path/to/keyfile removed\_email\_address@domain.invalid
> 
> and i log in without a glitch.
> 
> any idea what could be going wrong here? many thanks in advance.
> 
> tench

I am seeing the same issue. Does anyone know how to resolve this?

Biff
