List your Cloud Servers You can list all your servers by simply using the nova client’s list sub-command. Nova Help The nova client comes with a help subcommand. You can find out more about how to use other subcommands by passing their names as arguments to the help subcommand. For example, to find out more about the list subcommand: Build a Server To build a cloud server, you need to have two bits of information to hand: The image ID you want to boot with The ID of the virtual machine (flavour) you want to create Choose an Image To […]
If you’re looking to insert snippets of code into your WordPress site, you might find that the <code> and <pre> tags don’t quite cut the mustard. You could mess around with the CSS and stylise your tags. However the easiest solution is to simply find a nice plugin to use. My main requirement is that it supports the languages I’m interested in, namely Java, Python and Bash. However, for readability, it is also import to me that long lines of code is sideways scrollable and does not wrap itself onto the next line. I tend not to use the “Visual” […]
To install fail2ban on CentOS/RHEL 7, you first need to make sure you have the EPEL repository enabled. Then you can simply install it with yum as usual. Configure fail2ban You will need to create a file call jail.local. To do this, make a copy of jail.conf (do not edit this file), and edit that. To enable fail2ban to work with SSH, make sure enabled=true is somewhere under the [sshd] section. [sshd] enabled = true To make sure fail2ban is started and has picked up your changes, run the below. Check Service You should always check the service you have […]
In Red Hat 7 / CentOS 7, you may need to clear your repository cache if you see the below message when using yum. Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast To clear your cache simply run the below.
Nobody likes to log into their server and see this! Over 31,00 failed root login attempts in just a few days!! Disable Root Logins By default (on my system atleast), root logins are enabled. Before you disable root logins, make sure you have setup a regular user and can successfully login with that user using either a strong password or key-based authentication. To change the default setting, search for the following and remove the comment…. #PermitRootLogin yes …and change the value to no like so. PermitRootLogin no Don’t forget to restart SSH. Lock-down SSH by User Add each user that […]
Nobody likes to log into their server to see there have been over 31,00 failed login attempts in a few days!! [andy@bashful ~]$ ssh email@example.com Last failed login: Sun Feb 8 16:31:28 UTC 2015 from 184.108.40.206 on ssh:notty There were 31673 failed login attempts since the last successful login. Last login: Tue Feb 3 19:26:42 2015 [root@bashful ~]# I clearly need to make some improvements here! However first I want to record the number of failed login attempts so I can compare later, after my changes. Failed SSH login attempts are logged in /var/log/secure. Here we use a number of […]
To test that your Java Development Kit (JDK) is installed correctly, you need to write a simple Java program, compile it, and run the compiled bytecode. A simple Java HelloWorld example looks like this. You compile Java code with the javac command, and then run the resulting file with the java command. You should note that although the resulting Java bytecode is a file called HelloWorld.class, you run the program without any file extension. You could take this a step further and write some code that returns some Java system properties about the current installation. The below code makes use […]
You will need to export some environment variables used by the Nova client. If you have a UK-based Rackspace cloud account, you will need to enter something like this: …And if you have a US, Hong Kong and Sydney (based) account: Because we have our password in a plain text file, it is recommended that we at least lock down the permissions so no other system users can see it: Don’t forget that whenever you make changes to your bash profile that you need to run the below command first for the changes to take affect on your current users […]
Installing the Rackspace Nova client should just be as simple as installing the below packages. However, you will first need to make sure you have the development tools or the installation will fail with messages about not being able to find the GCC compiler.