Skip to content

linux

Installing SSHPT to Automate SSH Commands & File Transfers on Multiple Hosts

SSHTP is a great little Python script that will allow you to run SSH commands or transfer files on multiple hosts with a single command.  It’s simple to use.  You simply create a hosts file with all of the remote systems you want to execute a task on, then create a file with credentials to login and run the task.  You can even configure it to be executed via a website in multiple configurations (more info on that at the bottom).

 

sshpt_command_line_window

 

Click Here To Keep Reading!

Secure Apache In No Time, For Free, With an SSL Certificate From Let’s Encrypt!

Recently, I found out about a non-profit organization called Let’s Encrypt, which came into existence earlier this year.  Let’s Encrypt is a publicly trusted certificate authority that issues FREE SSL certificates.  The SSL Certificates are fully functional and extremely easy to request and install.  In fact, using Let’s Encrypt, it only takes about a minute to request and install an SSL certificate on Apache via the Linux command line, using a few simple commands.  If you have a Linux server(s) running any sort of public facing web server, there is no reason not to do this right now.  Here’s how to do it on Ubuntu 16.04 (although it should be the same process on any version of Ubuntu)!

 

Prerequisites

To install an SSL certificate from Let’s encrypt using this guide, you will need a couple things.

  • A server running Ubuntu 16.04 (although this should work on any version of Ubuntu)
  • Apache installed with a domain name(s) that is resolvable to the IP of the server.
    • If you are hosting multiple domains, you will need to be sure you have Virtual Hosts configured that properly specify the ServerName variable.

 

Install the Let’s Encrypt Client

 

To make things easy, there is a client available, based on python, that will do all of the hard work for you.  The package is called python-letsencrypt-apache.  Let’s use Aptitude to install it.

 

#  sudo apt-get update

# sudo apt-get install python-letsencrypt-apache

 

The client is now installed and we can move on to setting up the SSL certificate.

Click Here to Keep Reading!!

Configuring ownCloud 9 & Active Directory / LDAP Plugin Successfully

With this step-by-step guide, you will have your ownCloud 9 (and earlier) cloud server authenticating against Active Directory or LDAP correctly in no time!

Introduction

 

Recently, I went through the process of setting up a brand new ownCloud 9.1 server, after my previous ownCloud server had seen upgrades from 6.x all the way up to 8x.  If you’ve used ownCloud that long, you know the abundant changes and improvements that have been made along the way did not come without their growth pains; especially if you delved into encryption.  So, I decided to start fresh.  I use Active Directory to provide a centralized authentication source for everything in my personal “cloud,” so after setting up my new Dropbox clone, the first thing I needed to do was configure the LDAP user and group backend plugin.  I had a lot of problems getting the Active Directory usernames to match the ownCloud usernames, instead of showing a long string off numbers.  It was a lot of confusing UID, UUID, SAMAccountName and DN related confusion.  There aren’t any great guides to keep you from getting a headache, so I decided to make one.

 

Problems with the LDAP user and group backend plugin

 

It’s pretty straight forward to get an ownCloud server authenticating against and Active Directory server, but the biggest problem I’ve seen is the mapped usernames end up being long strings of numbers in ownCloud.  Although the display names are correct in owncloud, the actual username for all AD mapped logins, by default, are a long unique string makes things difficult.  For one, if you need to get to a users ownCloud data folder, there’s no intuitive way of knowing who’s is who’s folder from the command line.

With this step-by-step guide, you will have your ownCloud server authenticating against Active Directory / LDAP, with the following benefits:

 

  • The ownCloud username will match the Active Directory / LDAP username (no long incomprehensible string of numbers)
  • Any user added to a specified group created in Active Directory will automatically have ownCloud login privileges.
  • ownCloud users will be able to login using their username or email address (if specified in AD) interchangeably.

These three pluses make everything very seemless and saves a lot of headaches. So, lets get started.

Click Here to Continue Reading!

How-To Install ownCloud 9 / 9.1 / 9.x on Ubuntu 16.04 LTS for the ULTIMATE, Private, Dropbox Clone

Introduction

 

Let’s face it, since the advent of Dropbox, Box, Google Drive and the bazillion other cloud-based file synchronization platforms that have came into existence over the past decade, it’s almost a necessity. For the road warrior, using multiple devices, or even the traditional white-collar worker, having access to all of your files no matter what device you’re using is extremely convenient and adds an enormous productivity boost to our lives. One of my biggest concerns with all of the third-party services, however, is privacy and security. Allowing another entity to store my sensitive data, and trusting they will keep in secure, is pretty scary. Thankfully, there are many options to roll-your-own cloud file synchronization and it really doesn’t take much horsepower on the server side. With a low cost VPS (virtual private server), retired computer at home, or even a $25 RaspberryPi, you can easily build your own Dropbox clone that will put you in control of your own data. Today, I’ll walk you through setting up ownCloud 9.1 on Cannocial’s Ubuntu 16.04 LTS. I will be setting up my cloud on a virtual machine running on VMware ESXi, but the process is very similar no matter what hardware platform you choose. This step-by-step guide assumes you have a plain, unmodified, minimum installation of Ubuntu Server 16.04 LTS, with only SSH access. If you don’t have SSH running, or don’t want to enable it, console access will work just fine. So, lets get started!

 

Installing Prerequisites (Apache/MySQL/PHP)

 

Go ahead and login to your freshly installed Ubuntu 16.04 server.  Be sure to login with a username that has sudoer privileges.  This can be the username you selected during installation or specified when you provisioned your VPS.  Let’s make sure everything is up-to-date before going any further. We will use Aptitude to do so.

 

#  sudo apt-get update

#  sudo apt-get upgrade -y

 

Now we can jump in to the nitty gritty.  There are a few standard prerequisites needed for ownCloud to run.  Most people refer to this as the LAMP stack (short for Linux, Apache, MySQL, PHP).

Click Here To Continue Reading!

How to install ownCloud on Ubuntu 14.04 LTS – Your own Open Source Dropbox

Dropbox is great.  But, you are putting your private, personal data in a corporations hands.  That is a bit scary if you stop and think about it.  The good news is that you can run your own Dropbox, using an Open Source software package called ownCloud.  It’s amazing and works very well.  In this guide, we’ll be installing ownCloud on Ubuntu 14.04 LTS.  It’s not very hard, and when it’s all said and done you have your own personal cloud storage platform that you control.  You can even enable server-side encryption so that if you server is compromised, your data is still safe.  Lets get started.

 

How to install ownCloud on Ubuntu 14.04 LTS

 

This tutorial assumes you have installed Ubuntu 14.04 and have updated it to the latest and greatest using the commands below.  Just FYI, I’m installing it on a virtual machine on ESXi 5.5.  So, make sure everything is updated using these two commands.

 

#  sudo apt-get update

#  sudo apt-get upgrade

 

Next, we need to install a webserver (Apache), a database server (mysql) and PHP.  This is commonly called the LAMP stack.  Fortunately, this only requires two simple commands now, thanks to taskel.

 

#  sudo apt-get install taskel

#  sudo taskel install lamp-server

 

During installation, you will be prompted to set a root password for mysql.  Make sure to set this as a secure password, and do not forget it!

 

2016-03-03 15_36_10-mike@stash_ ~

 

Click Here To Continue Reading!!

How to get URL rewrites & WordPress Permalinks working on Directadmin & Nginx

It’s no secret that I love using the Directadmin control panel.  The interface is very simplistic, and can be archaic at times, but it is very stable, fast, and extremely customization when using the Custombuild 2.0 scripts.  Recently, I did just that to deploy Nginx as the back-end web server, instead of the default, which is Apache.  Nginx is very fast and performs very well under heavy loads.  After migrating serenity-networks.com over, I quickly noticed that none of my links are working.  Because I use WordPress, I instantly knew it had something to do with .htaccess or permalinks.  The first thing I did was set permalinks to default, and everything started working again.  Nginx does not use, nor recognize .htaccess files, which are imperative to URL rewriting, and therefore permalinks.  So, I had to figure out how to solve this issue using configuration parameters in the Nginx.conf file.  But, this isn’t very straightforward with Directadmin.  Here is how to do it.

How to get URL rewrites and WordPress permalinks working with Directadmin, Custombuild 2.0, and Nginx:

The first thing you need to know is how Directadmin handles Nginx configuration files.  This is pretty simple.  It’s done on a per user bases, and the configuration files are located in /usr/local/directadmin/data/users/username/nginx.conf.   Pretty simple.  Each username has a folder, and within that folder is an nginx.conf file.  This is where you can set parameters per user and even drill down to a specific site for a user.  So, the first thing we will do is go to that directory, and edit the appropriate nginx.conf file for your user.

cd /usr/local/directadmin/data/users/

Look for the username for your user and cd into that directory.  If you do an ls, you will see many different files.

nginxconfdir

 

Click here to continue reading!

How to install Arachni, Nikto, and Wapiti for OpenVAS on Ubuntu 14.04 LTS

If you don’t already have OpenVAS installed, click here if you need help installing OpenVAS 8 on Ubuntu 14.04, or click here if you need help installing OpenVAS 7 on CentOS 7. If you have installed OpenVAS 8 (or an older version), you might have noticed some of these peculiar errors in your scan reports.

Vulnerability Detection Result
Arachni could not be found in your system path.
OpenVAS was unable to execute Arachni and to perform the scan you
requested.
Please make sure that Arachni is installed and that arachni is
available in the PATH variable defined for your environment.

Screen Shot 2015-06-05 at 8.41.47 PM

Vulnerability Detection Result
Nikto could not be found in your system path.
OpenVAS was unable to execute Nikto and to perform the scan you
requested.
Please make sure that Nikto is installed and that nikto.pl or nikto is
available in the PATH variable defined for your environment.

Click Here To Read The Rest!