How Do You Configure Ruby to Work Properly with the Chef Development Kit on Ubuntu 16.04?

Problem scenario
You are running Ubuntu 16.04 Linux.  You tried to follow the directions for installing the Chef development kit on these two sites: GitHub and Chef.io.  But they do not work.  What should you do?

Solution
Follow these steps:

1.  Change directories to the home directory (e.g., /home/ubuntu or /root/) of the user are logged in as. 
2. 

How Do You Create a Chef Recipe to Install Java on Linux Chef-Client Nodes?

Problem scenario
You have Linux servers that need Java 1.8 installed on them.  How do you write a Chef recipe to deploy Java?

Solution
Prerequisite
This solution requires that the Chef server must have access to GitHub.  If you want to install Chef server, see this posting.  If you want to install Chef client, see this posting

How Do You Troubleshoot the Knife (Chef) Error “You authenticated successfully but you are not authorized … missing read permission”?

Problem scenario
You have installed Chef on Ubuntu.  You run this command:

sudo knife client list

You expect to see a list of Chef client nodes.  But you see an error like this:

“ERROR: You authenticated successfully to https://<FQDN of Chef Server>/organizations/companynickname as <FQDN of Chef client node> but you are not authorized for this action
Response:  missing read permission”

What do you do?

When Using Chef’s Knife Command How Do You Solve The “Error: failed to authenticate … invalid signature for user or client” problem?

Problem scenario
You are trying to use Chef’s knife command.  Every time you try to regenerate a key or delete a user, you get an error like this:

“ERROR: Failed to authenticate to https://continualintegration.com/organizations/contintnickname as contint with key /home/ec2-user/.chef/contint.pem
Response:  Invalid signature for user or client ‘contint'”

What do you do?

Solution
1.  Log into the GUI for Chef Manage. 

How Do You Create a Recipe or Cookbook to Make a Configuration Change on a Chef Client?

Problem scenario
You have a desired configuration that you want implemented with Chef.  You want a command to execute and a file to transfer via a Chef recipe or cookbook.  You have installed Chef server on one server (see this posting if you want to do this) and Chef client on another (see this posting for installing Chef client).  You want to use Chef for the first time doing something as an example. 

How Do You Troubleshoot the Error “curl: (6) Could not resolve host: Unknown error”?

Problem scenario
You are using RedHat Enterprise Linux in AWS.  curl commands are not working.  DNS names are not resolving accurately.  For example, you try this command:  curl http://icanhazip.com

You get this error:
“curl: (6) Could not resolve host: icanhazip.com; Unknown error”
How do you fix this to get curl commands to work (and make sure that FQDNs resolve properly)?

Solution
Do these four things:

1. 

How Do You Deploy a Standalone Chef Server to a Linux Server?

Updated 10/13/19

Problem scenario
You want to deploy Chef server to Linux in a standalone fashion.  What do you do?

Solution
This solution has been tested to work with Ubuntu 16.04 Linux in AWS or Azure.  This solution has also been tested to work with RHEL 7.4 in AWS.

#1  For a standalone deployment, you will need a server with 4 CPU cores and 4 GB of RAM according to this 

Should You Be Concerned about Surge Protection for Your Laptop If You Use a Hard-Wired Connection with a Network Cable?

Problem scenario
You live in an are that is susceptible to lightning (most of the world).  You use a power strip or UPS with surge protection.  Surge protection is made possible via a MOSFET (metal-oxide semi-conductor field effect transistor) that is destroyed when the power surges to potentially destructive levels.  You do not have surge protection on the coaxial cable to the coaxial modem.  You are concerned that if lightning were to strike,

How Do You Use scp When You Get A “Permission Denied” Error?

Problem scenario
You want to copy files between RedHat Linux servers with adherence to security best practices.  You try to use scp but you get “Permission denied.”  What do you do to copy files in a secure way?

Solution
1.  Verify you can SSH from one server to the other.  For directions for setting up SSH in a cross-cloud environment, you may want to see this posting