Knife bootstrap error

Hi,

I am practicing the chef training session
https://learn.chef.io/modules/manage-a-node-chef-server/rhel/bring-your-own-system#/

I allocated 3 nodes (roles are : workstation, chef-server, a-node) to practice this class,

I run this command on the node "workstation" to bootstrap "a-node" to be a chef client node,

knife bootstrap 134.79.129.170 --ssh-user gtsai --identity-file /home/gtsai/.ssh/id_rsa --node-name dhcp-os-129-170 --run-l st 'recipe[learn_chef_httpd]' -VV
=>
INFO: Using configuration from /home/gtsai/learn-chef/.chef/knife.rb
Node dhcp-os-129-170 exists, overwrite it? (Y/N) y
Client dhcp-os-129-170 exists, overwrite it? (Y/N) y
Creating new client for dhcp-os-129-170
Creating new node for dhcp-os-129-170
Connecting to 134.79.129.170
DEBUG: Adding 134.79.129.170
gtsai@134.79.129.170's password:
gtsai@134.79.129.170's password:
134.79.129.170 Unmatched '.
134.79.129.170 TMPDIR: Undefined variable.
134.79.129.170 tmp=/tmp: Command not found.
134.79.129.170 else: endif not found.

Can you help please?
Thanks.
Grace

Hi Grace-

Can you confirm that that gtsai account exists on the target node? This looks like an authentication issue on the node you're trying to bootstrap. Can you ssh directly into 134.79.129.170 as gtsai with either your password, or the specified ssh key?

Hi, Brad,

Thanks for your reply.

`

`

`Both of the nodes and have

`

/home/gtsai/.ssh/id_rsa

From my desktop, I do

as "gtsai"

ssh <workstation>

=> logged in, no password is needed.

`

`

From the <workstation>

as "gtsai"

`ssh

`

=> logged in, no password is needed.

`

`

Thanks.

Grace

``

Hi, Brad,

`

`

Let me answer it again, my previous answer can not translate "<" and ">" well.

`

`

``

Hi, Brad,

Thanks for your reply.

`

`

`Both of the nodes workstation and a-node have

`

/home/gtsai/.ssh/id_rsa

From my desktop, I do

as "gtsai"

ssh "workstation*

=> logged in, no password is needed.

`

`

From the *workstation*

as "gtsai"

`ssh a-node

`

=> logged in, no password is needed.

`

`

Thanks.

Grace

Hi, Brad,

Thanks for your reply.

Both of the nodes workstation and a-node have

/home/gtsai/.ssh/id_rsa

From my desktop, I do

as "gtsai"

ssh workstation
=> logged in, no password is needed.

From the workstation, I do:

as "gtsai"

ssh a-node
=>logged in, no password is needed.

Thanks.

Grace

Strange... That should be essentially exactly what knife is doing. What OSes are these? From your workstation (which is where you should be attempting the knife bootstrap command from), run this command:

ssh gtsai@134.79.129.170 -i /home/gtsai/.ssh/id_rsa "echo \`whoami\`@\`hostname\`"

and paste in the output here... If successful, it should show:

gtsai@<whatever the hostname of 134.79.129.170 is here>

Trying to recreate as closely as possible what knife is actually doing. I suspect this is going to be something silly, but based on your note above about getting logged in manually, this should be working, which is why I want you to attempt that command and paste in the output. :slight_smile:

My workstation node is a RHEL7 dhcp-os-129-166
My a-node is a RHEL7: dhcp-os-129-170 , IP=134.179.129.170

On my wokrstation node

[gtsai@dhcp-os-129-166 ~]$ ssh gtsai@134.79.129.170 -i /home/gtsai/.ssh/id_rsa "echo `whoami`@`hostname`"
=>
gtsai@dhcp-os-129-166
(I am still in workstation)

Now from my workstation,
[gtsai@dhcp-os-129-166 ~]$ ssh gtsai@134.79.129.170 -i /home/gtsai/.ssh/id_rsa "
=>
I am in the a-node

[gtsai@dhcp-os-129-170 ~]$ whoami
=>
gtsai

Sent PM.