Tuesday, June 29, 2010

Encrypting the Backup...

 

By now many of you might have come to know about the importance of backing up the data.To make the backed up data much more secure we have to encrypt the data so that,those who know the password can only check the data.
If you have ssl installed on your system, you can use it to encrypt your backup.

echo "your_key" > /tmp/.key

to save your data =>

tar cvf - files_to_save | openssl enc -des3 -salt -pass file:/tmp/.key >/dev/rmt0

to restore your data =>

openssl enc -d -des3 -pass file:/tmp/.key </dev/rmt0 | tar xvf -

NOTE:DON'T FORGET THE /tmp/.key file WHEN YOU ARE DONE WITH IT.!!!!

Where,
    * /dev/rmt0 : Tape device name.
    * openssl : The OpenSSL toolkit command line utility.
    * tar : The tar archiving utility.
    * des3 : Triple-DES Cipher (Triple DES is the common name for the Triple Data Encryption Algorithm).
    * -salt : The -salt option should ALWAYS be used if the key is being derived from a password unless you want compatibility with previous versions of OpenSSL and SSLeay. Without the -salt option it is possible to perform efficient dictionary attacks on the password and to attack stream cipher encrypted data. The reason for this is that without the salt the same password always generates the same encryption key. When the salt is being used the first eight bytes of the encrypted data are reserved for the salt: it is generated at random when encrypting a file and read from the encrypted file when it is decrypted. (source enc man page)

Saturday, June 26, 2010

Changing Wordpress admin link to whatever you like.

 

Every one might have heard about wordpress and those who have hosted their site using wordpress t will know that the default admin login link is given as wp-admin. So once the intruder gets the login page then he can try any tricks to crack into your hosted site.So for security purposes its better to hide ur admin login link so that it will be difficult for anyone to get find it…

This is how it is done…..

Locate your .htaccess file and edit it in the following way:

Edit your .htaccess file and add the following lines:

######################
RewriteEngine On
RewriteBase /
##### ABOVE THIS POINT IS ALREADY INSERTED BY WORD PRESS
##### Michi’s code is BELOW #####
RewriteCond %{REQUEST_URI} wp-admin/
RewriteCond %{QUERY_STRING} !YOURSECRETWORDHERE
RewriteRule .*\.php [F,L]
RewriteCond %{QUERY_STRING} !YOURSECRETWORDHERE
RewriteRule ^ADMINFOLDER/(.*) wp-admin/$1?%{QUERY_STRING}&YOURSECRETWORDHERE [L]
##### Dejavu’s code is ABOVE #####
##### BELOW THIS POINT IS ALREADY INSERTED BY WORD PRESS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#####################

Additional info:
* Change YOURSECRETWORDHERE to something else. It can be any word you want. Just make sure it’s unique and somewhat long. Make it, like, your pets name or something random. Read this post to understand why this matters.
* Change ADMINFOLDER to the new folder name you want. Letters, numbers, underscores, and dashes only. That ^ in front of it is on purpose. Don’t delete that.

 

Now your blog is a bit more secure than before….ENjoy..!!!!!!!!!!!

Thursday, June 24, 2010

Virtual Box –folders sharing-Permission problem.

 

While sharing folders between host and a virtual machine using Virtual box, Sometimes you may face the problem that after a folder is shared to the virtual machine from host machine you don't find execute permissions on the files shared and if you try to set the execute permissions with chmod command that don't work.

Here is an ugly way to make that work, if you are good at coding then you can  edit the vboxvfs kernel module (the joys of open source!).

NOTE: Do the steps at ur own risk..!!!

How to:
1. mount the VBoxGuestAdditions.iso (e.g. /media/cdrom0)
2. mkdir vbox && cd vbox && /media/cdrom0/VBoxLinuxAdditions.run --tar -xf
3. edit module/vboxvfs/utils.c, change line 96 "mode |= mode_set (IXUSR);" to "mode |= S_IXUSR;" (note addition of "S_" prefix... basically, always set executable flag)
4. sudo ./install.sh vfs-module
5. cd .. && rm -rf vbox

This sets the executable flag in the guest only (mode 700) for all shared files — the host still always gets mode 500 for newly created files. Hopefully a dev can make a proper fix. (slight improvement: set executable on new file creation, and keep file permissions in sync otherwise so non-executables in the host don't show up as executable in the guest)

But at least this lets you to do some development within a shared directory...

 
Things You Should Know About Linux !!!