# Knife ssh issues

**URL:** <https://discourse.chef.io/t/knife-ssh-issues/4224>\
**Category:** Chef Infra (archive)\
**Created:** [July 22, 2013, 2:14pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224 "2013-07-22T14:14:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cassiano\_Leal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cassiano_leal/32/86_2.png) [@Cassiano\_Leal](https://discourse.chef.io/u/Cassiano_Leal)\
**Post date:** [July 22, 2013, 2:14pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224/1 "2013-07-22T14:14:23Z")

</div>

Hi,

I’m trying to use knife ssh to run chef-client on demand on some servers, but it’s failing with this message:

WARNING: Failed to connect to – SocketError: getaddrinfo: nodename nor servname provided, or not known

The servers are on an AWS VPN to which I connect via VPN. Is this something that’s missing on my part, maybe knife configuration?

## Cheers,

Cassiano Leal  
[http://cassianoleal.com](http://cassianoleal.com)  
[http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)

---

<div class="post-metadata">

**Author:** ![Mat\_Schaffer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/mat_schaffer/32/315_2.png) [@Mat\_Schaffer](https://discourse.chef.io/u/Mat_Schaffer)\
**Post date:** [July 22, 2013, 2:23pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224/2 "2013-07-22T14:23:02Z")

</div>

This often means that the node name isn't resolvable by DNS.

You can specify an alternate attribute to use as the connection hostname  
with 'knife ssh -a'

On Monday, July 22, 2013, Cassiano Leal wrote:

> Hi,
> 
> I’m trying to use knife ssh to run chef-client on demand on some servers,  
> but it’s failing with this message:
> 
> WARNING: Failed to connect to -- SocketError: getaddrinfo: nodename nor  
> servname provided, or not known
> 
> The servers are on an AWS VPN to which I connect via VPN. Is this  
> something that’s missing on my part, maybe knife configuration?
> 
> ## Cheers,
> 
> Cassiano Leal  
> [http://cassianoleal.com](http://cassianoleal.com)  
> [http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)

--

-Mat

> **[Mat Schaffer on about.me](https://about.me/matschaffer)**
>
> I live in Gifu Japan.

---

<div class="post-metadata">

**Author:** ![Cassiano\_Leal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cassiano_leal/32/86_2.png) [@Cassiano\_Leal](https://discourse.chef.io/u/Cassiano_Leal)\
**Post date:** [July 22, 2013, 4:53pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224/3 "2013-07-22T16:53:26Z")

</div>

It really is not resolvable, as it’s an internal AWS name.

Using -a solved it, thanks a lot!

Is there a way to set this (and probably -x along with it) as a default, say in knife.rb?

## Thanks!

Cassiano Leal  
[http://cassianoleal.com](http://cassianoleal.com)  
[http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)

On July 22, 2013 at 11:23:20, Mat Schaffer ([mat@schaffer.me](mailto:mat@schaffer.me)) wrote:

This often means that the node name isn't resolvable by DNS.

You can specify an alternate attribute to use as the connection hostname with 'knife ssh -a'

On Monday, July 22, 2013, Cassiano Leal wrote:  
Hi,

I’m trying to use knife ssh to run chef-client on demand on some servers, but it’s failing with this message:

WARNING: Failed to connect to -- SocketError: getaddrinfo: nodename nor servname provided, or not known

The servers are on an AWS VPN to which I connect via VPN. Is this something that’s missing on my part, maybe knife configuration?

## Cheers,

Cassiano Leal  
[http://cassianoleal.com](http://cassianoleal.com)  
[http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)

--

-Mat

> **[Mat Schaffer on about.me](https://about.me/matschaffer)**
>
> I live in Gifu Japan.

---

<div class="post-metadata">

**Author:** ![Mike](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/mike/32/18_2.png) [@Mike](https://discourse.chef.io/u/Mike)\
**Post date:** [July 22, 2013, 5:25pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224/4 "2013-07-22T17:25:09Z")

</div>

Cassiano,

You can set these values in knife.rb:

knife[:ssh\_attribute] = 'ec2.local\_ipv4' # or such  
knife[:ssh\_user] = 'ubuntu'

There's more configs, you might want to try knife-config to see them  
all. [http://jtimberman.housepub.org/blog/2012/03/25/knife-config-plugin/](http://jtimberman.housepub.org/blog/2012/03/25/knife-config-plugin/)

-M

On Mon, Jul 22, 2013 at 12:53 PM, Cassiano Leal [cassianoleal@gmail.com](mailto:cassianoleal@gmail.com) wrote:

> It really is not resolvable, as it’s an internal AWS name.
> 
> Using -a solved it, thanks a lot!
> 
> Is there a way to set this (and probably -x along with it) as a default, say  
> in knife.rb?
> 
> Thanks!
> 
> --  
> Cassiano Leal  
> [http://cassianoleal.com](http://cassianoleal.com)  
> [http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)
> 
> On July 22, 2013 at 11:23:20, Mat Schaffer ([mat@schaffer.me](mailto:mat@schaffer.me)) wrote:
> 
> This often means that the node name isn't resolvable by DNS.
> 
> You can specify an alternate attribute to use as the connection hostname  
> with 'knife ssh -a'
> 
> On Monday, July 22, 2013, Cassiano Leal wrote:
> 
> > Hi,
> > 
> > I’m trying to use knife ssh to run chef-client on demand on some servers,  
> > but it’s failing with this message:
> > 
> > WARNING: Failed to connect to -- SocketError: getaddrinfo: nodename nor  
> > servname provided, or not known
> > 
> > The servers are on an AWS VPN to which I connect via VPN. Is this  
> > something that’s missing on my part, maybe knife configuration?
> > 
> > Cheers,
> > 
> > --  
> > Cassiano Leal  
> > [http://cassianoleal.com](http://cassianoleal.com)  
> > [http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)
> 
> --
> 
> -Mat
> 
> [Mat Schaffer - Gifu Japan | about.me](http://about.me/matschaffer)

---

<div class="post-metadata">

**Author:** ![Cassiano\_Leal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cassiano_leal/32/86_2.png) [@Cassiano\_Leal](https://discourse.chef.io/u/Cassiano_Leal)\
**Post date:** [July 22, 2013, 5:41pm UTC](https://discourse.chef.io/t/knife-ssh-issues/4224/5 "2013-07-22T17:41:00Z")

</div>

Fantastic!

Thanks for the help guys!

## Cheers,

Cassiano Leal  
[http://cassianoleal.com](http://cassianoleal.com)  
[http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)

On July 22, 2013 at 14:25:27, Mike ([miketheman@gmail.com](mailto:miketheman@gmail.com)) wrote:

Cassiano,

You can set these values in knife.rb:

knife[:ssh\_attribute] = 'ec2.local\_ipv4' # or such  
knife[:ssh\_user] = 'ubuntu'

There's more configs, you might want to try knife-config to see them  
all. [http://jtimberman.housepub.org/blog/2012/03/25/knife-config-plugin/](http://jtimberman.housepub.org/blog/2012/03/25/knife-config-plugin/)

-M

On Mon, Jul 22, 2013 at 12:53 PM, Cassiano Leal [cassianoleal@gmail.com](mailto:cassianoleal@gmail.com) wrote:

> It really is not resolvable, as it’s an internal AWS name.
> 
> Using -a solved it, thanks a lot!
> 
> Is there a way to set this (and probably -x along with it) as a default, say  
> in knife.rb?
> 
> Thanks!
> 
> --  
> Cassiano Leal  
> [http://cassianoleal.com](http://cassianoleal.com)  
> [http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)
> 
> On July 22, 2013 at 11:23:20, Mat Schaffer ([mat@schaffer.me](mailto:mat@schaffer.me)) wrote:
> 
> This often means that the node name isn't resolvable by DNS.
> 
> You can specify an alternate attribute to use as the connection hostname  
> with 'knife ssh -a'
> 
> On Monday, July 22, 2013, Cassiano Leal wrote:
> 
> > Hi,
> > 
> > I’m trying to use knife ssh to run chef-client on demand on some servers,  
> > but it’s failing with this message:
> > 
> > WARNING: Failed to connect to -- SocketError: getaddrinfo: nodename nor  
> > servname provided, or not known
> > 
> > The servers are on an AWS VPN to which I connect via VPN. Is this  
> > something that’s missing on my part, maybe knife configuration?
> > 
> > Cheers,
> > 
> > --  
> > Cassiano Leal  
> > [http://cassianoleal.com](http://cassianoleal.com)  
> > [http://twitter.com/cassianoleal](http://twitter.com/cassianoleal)
> 
> --
> 
> -Mat
> 
> [Mat Schaffer - Gifu Japan | about.me](http://about.me/matschaffer)
