Knife bootstrap failing on Ubuntu

Here is the bootstrap command that I use.

knife bootstrap "{UNAME}"@"{HNAME}" --node-name "{HNAME}" --secret-file "{DBAGPATH}" --sudo

This works perfectly on CentOS and Fedora but always fails with Ubuntu. I found out that the SSH connection uses Dash shell rather than Bash. How do I make knife use Bash?

When I use the command below, it works.

ssh "{UNAME}"@"{HNAME}" 'bootstrap.sh`

Help.

Thank you in advance.

Perhaps try this format:

knife bootstrap hostname-or-ipaddress -U username -i path-to-SSH-private-key --sudo -N nodename

I'm not familiar with the format you suggested, but I use this all the time with ubuntu 16.04

-Elon

Thanks, Elon.

I tried you way but it still fails due to the connection using Dash Shell. I have an airgapped environment so I had to create a bootstrap script. I chose bash as it seems very popular. Running the bootstrap script locally works when run in the Bash shell.