Sometimes you might need to test whether a specific port is open in Linux based on your firewall rules. Without having to install specific software (e.g, telnet server for port 21) you can test this using netcat.
This can be handy if you need to prove to a service provider that they are blocking your ports.

Example, port 21

On the server side:
For ports under 1000 you must be root/sudo user

sudo netcat -l 21

On the client side

netcat [server ip] 21

It will look like nothing has happened. On the client side, just type some random words, e.g. “Hello World!” and hit [ENTER]. If the connection was successful, you should see the same words echoed on the server side.

To end the session you can either use CTRL+C on the server side (will kill both sides) or CTRL+D on the client side (will only kill the client side)

In a previous article, Linux – Enable auto-login via SSH, I explained how you can eliminate the need to enter your password every time you log on to a specific host.

You might run into a problem where you get the following error message:
“Agent admitted failure to sign using the key”

You then need to type in the password again. Pointless.

To fix it is quite simple:
Continue reading

Ubuntu text boot

First things first – remember, always back up important system files before editing!

If you want to view the tradional kernel message output when booting into Ubuntu, you can do it as follows:

Edit /etc/default/grub and edit the following line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to:
Continue reading

apt-get logo

Experience the following?:

<snipped>
...
...
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en    
Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en    
Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en      
Ign http://us.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US             
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/i18n/Translation-en  Hash Sum mismatch
 
E: Some index files failed to download. They have been ignored, or old ones used instead.

The cause is likely a corrupt package file previously downloaded. You can fix it by doing the following:

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update

apt-get logo

More often than not, I have to deploy a system which will not have access to the internet or an apt-proxy/apt-cacher installations somewhere. This means I cannot install new packages which might be required at a later stage.

I’ll use an example install of postgresql to explain how you can get all the required files (specifically for your machine) and deploy it on your server.
Continue reading

Enter your Ubuntu credentials

This is an update of a previous post, found here. I’ve added a section to the bottom which explains how you can connect to the same session each time.

If you need to connect to a Linux machine, and in the scope of this guide, Ubuntu 14.04 (I’m sure this guide should be fine for earlier versions as well), then your options include:

  • Pure and simple SSH – The admin’s super tool! (just install openssh-server – works every time!)
  • VNC – I don’t like this method because you need to install software on your client AND server
  • XRDP – This still involves VNC to some degree but you can use the normal Windows Remote Desktop Client

The latter is the one I’ll guide you through here. Continue reading

RAID Config Screen

In this day and age, you need your machines to be up and running 100% of the time, or as close to that as possible. This means that rebooting a server just to get some detail about your RAID configuration is completely out of the question.

Luckily, some RAID cards have the ability to be configured even from a running system. In the case of this article, we’re looking at LSI or PERC (As the Dell guys call them) cards.
Continue reading