How to Install Suricata on an AWS Instance of RedHat Enterprise Linux Server

Updated 11/29/17

These directions will allow you to install Suricata.  The script in step 2 was designed to install Suricata 4.0.1 on an AWS instance of RHEL 7.4.  This script requires that your AWS RedHat Enterprise Linux server is in a security group that has access to the internet.  You do not need a subscription to RedHat packages. 

Step #1  Log into the Red Hat Enterprise Linux server. 
Step #2 

How To Install PsExec on Windows Server

Not all directions are clear.  Here is an example where Microsoft has less than perfect directions:

“Installation

Just copy PsExec onto your executable path. Typing “psexec” displays its usage syntax.”

First off, psexec won’t display usage syntax until after the installation. If you are like me you are asking what is the executable path?

The answer can be found by opening PowerShell and typing this:

Get-ChildItem Env:Path | ft -wrap -AutoSize

Any of those semi-colon delimited results can be the destination of the files inside the PsTools.zip file. 

How Do Build and Release Engineers Target Specific Servers With Jenkins Builds?

Problem scenario:  Using a configuration management tool, you can modify the selections of servers for your configurations to exclude specific servers.  With Puppet Master you can create classes of nodes (that exclude various Puppet Agent servers) and have manifests apply to the class.  In Puppet you can also write manifests that specify individual servers.  Chef recipes can target certain Chef clients and exclude others.  SaltStack allows the Salt Master server to “call a highstate” (or run an action) on specific Salt Minion servers to push down files or execute commands while ignoring multiple Salt Minions. 

Troubleshooting Jenkins (Two Different Problems)

Problem scenario:  You are in the Jenkins master web UI and are trying to configure a Jenkins node (previously known as a slave) instance.  You entered the correct hostname, username and password.  You get this error:

“ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
java.lang.IllegalStateException: Connection is not established!”

Solution:  Instead of using the hostname of the Jenkins node (previously known as a slave) server,

How Do You Install libyaml on a Red Hat Derivative of Linux?

Problem scenario
You are using a RedHat derivative of Linux.  You get an error about libyaml not being installed (e.g., when a dependency of Suricata is unmet).  You tried to install libyaml-devel, but it did not work.  What should you do?

Solution for RHEL
If you are using RedHat run these two commands:

sudo yum-config-manager –enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
sudo yum -y install libyaml-devel

Solution for CentOS/Fedora
If you are using CentOS or Fedora, go here to get the package you need.

[Sassy_Social_Share]

Troubleshooting and an FYI Regarding OpenSSH

Problem scenario #1
You try to SSH to a Windows server with OpenSSH.  You get “Permission Denied.”
Solution
Go to the Windows server.  Go to Server Manager -Tools -Computer Management -Users and Groups.  Double click on the user you are trying with.  Uncheck “User must change password at next log on.”  This setting will not allow an SSH connection to happen.

Problem scenario #2
ssh-agent service is running on a Windows server with OpenSSH. 

How Do You Create an RSA Private/Public Key Pair with OpenSSH in Windows?

Problem scenario
You have OpenSSH installed on a Windows machine.  You are in a PowerShell prompt as Administrator in the directory where the ssh-keygen.exe file is.  You run this:  .\ssh-keygen.exe -t rsa
You get “Generating public/private rsa key pair.”  No new prompt appears.  It hangs (or stalls) for a long time.  You wait, and find that it is essentially frozen.  You control-c to interrupt it and move on.

You are in a PowerShell prompt as Administrator in the directory where the ssh-keygen.exe file is. 

Two Error Messages when Installing Gems On Linux

Problem scenario:  You are trying to use gem install, but you get an error like this:
“usr/bin/ruby extconf.rb
mkmf.rb can’t find header files for ruby at /usr/lib/ruby/ruby.h”

Solution:  Install ruby-devel.  For RedHat deriviatives, you can find the rpm here.

=====================================================================================

Problem scenario:  You are running gem install *.gem, and you get ‘ERROR: While executing gem …

Using a rubyntlm script (http.rb), you get “connection refused.”

Problem scenario:  You modify this script to have a hostname, username, and password of a Windows server with IIS installed.  You add a “puts line” stanza on line 32 for debugging.  You try to run the script with ruby http.rb, but you get “connection refused.”  

Possible solutions:  If you changed the port stanza in the http.rb file from 80, make sure there is no firewall blocking the port in the path to the Windows server. 

Rubyntlm: Communication from a Linux Server to a Windows Server

Problem scenario:  You modify this script to have a hostname, username, and password of a Windows server on your network.  You add a “puts line” stanza on line 32.

You run the script but you get a message like this: “HTTP/1.1 404 Not Found error. “

Solution:  Make sure that the Windows server has IIS installed, make sure the server name you entered was correct,