iptables start on boot – Ubuntu/Debian

 

By default Ubuntu/Debian OS wont load iptable on boot.

So to load iptables on boot use follow procedure:

Save iptable conf with iptables-save command:

iptables-save > /etc/iptables.conf

Next, open file with name /etc/network/if-up.d/iptables and add following content:

#!/bin/sh
iptables-restore < /etc/iptables.conf

Change permission file /etc/network/if-up.d/iptables as executable with following command:

chmod +x /etc/network/if-up.d/iptables

Now, iptables will restored on boot.

Whenever you change iptable rules don’t forgot to update iptables.conf file. Use following command to update iptables.conf file:

iptables-save > /etc/iptables.conf

Heartbleed Ubuntu 12.04 – 64 bit fix

 

What is HeartBleed?

The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. This weakness allows stealing the information protected, under normal conditions, by the SSL/TLS encryption used to secure the Internet. SSL/TLS provides communication security and privacy over the Internet for applications such as web, email, instant messaging (IM) and some virtual private networks (VPNs).

The Heartbleed bug allows anyone on the Internet to read the memory of the systems protected by the vulnerable versions of the OpenSSL software. This compromises the secret keys used to identify the service providers and to encrypt the traffic, the names and passwords of the users and the actual content. This allows attackers to eavesdrop on communications, steal data directly from the services and users and to impersonate services and users.

Affected OpenSSL versions:

Only 1.0.1 and 1.0.2-beta releases of OpenSSL are affected including 1.0.1f and 1.0.2-beta1.

How to check your OpenSSL Version?

Use following command to know your OpenSSL version:

$ openssl version -a

If you are using any of above mentioned affected versions of OpenSLL please upgrade your OpenSSL.

How to upgrade OpenSSL?

I used following script to upgrade OpenSSL to fixed vision:

#!/bin/bash
openssl version -a
apt-get install zlib1g-dev -y
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.1-4ubuntu5.12_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.1-4ubuntu5.12_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.0.1-4ubuntu5.12_amd64.deb
dpkg -i libssl1.0.0_1.0.1-4ubuntu5.12_amd64.deb
dpkg -i libssl-dev_1.0.1-4ubuntu5.12_amd64.deb
dpkg -i openssl_1.0.1-4ubuntu5.12_amd64.deb
rm libssl1.0.0_1.0.1-4ubuntu5.12_amd64.deb libssl-dev_1.0.1-4ubuntu5.12_amd64.deb openssl_1.0.1-4ubuntu5.12_amd64.deb
openssl version -a

After execution of above script reboot your machine, unless you reboot machine OpenSSL version won’t change.

After upgrade your OpenSSL version should look like following:

$ openssl version -a

Output:

OpenSSL 1.0.1 14 Mar 2012
built on: Mon Apr 7 20:33:29 UTC 2014
platform: debian-amd64

Linux change password on next login

 

By using change command we can force a user to change password on first login or next login.

Syntax:

chage -d 0 <UserName>

Example:

Here I am using trying to change ‘tom’ users password on next/first login.

$ change -d 0 tom

-d 0: By setting it to zero, we are going to force user to change password on next/first login.