Posts Tagged “Linux”

Booting a Linux Vm in VMware is a pretty task and it’s helpful, especially if you forget your password or are having other issues such as security related issues. This also works for any Linux server as long as you have console access (Not Remote) access to it. IE standing in front of it.

This process will explain how to boot your VM into the single-user mode, so listen up.

  1. You’ll need to have console access to that VM, otherwise it will boot normally.
    Once the VM is loading and you see the Vmware boot screen. Once this goes away you will see the Linux Grub Boot screen. Press any key to stop the boot process.

  2. You will now see a screen similar to this. These are the OS / Kernel’s for your VM. Always choose the upper most listing. Highlight this and press the “A” key.

    Read the rest of this entry »

Tags: , , , , ,

Comments No Comments »

To improve the security of a Linux server, especially a web server, which is exposed to the Internet and possible worldwide hackers, it’s best to enable the server to automatically send a notification email to predefined email address anytime someone logs in as root to the host. To configure the automatic email alert notification to a default email address on each incident of root log on on the server, use the following guide.

1. Login to the server via SSH using as root ID.
2. Ensure that you’re at home directory of root. Then open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line:

Using Pico# pico .bash_profile
Using Nano# nano .bash_profile
Using Vi# vi .bash_profile

3. Scroll down to the end of the file and add the following line:

“echo ‘ALERT – echo ‘ALERT – Root Shell Access (YourserverName) :’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” [email protected]” (Without the quotes)

4. Replace [email protected] with the actual email account address that you want to the root access alert notification been sent to. Note that you can change the text contains in the email alert too. You will want to change the (YourserverName) to your actual server name or hostname.

Now logout and login again as root, you should receive an email alert at your inbox. This works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD , etc.

Tags: ,

Comments No Comments »

Browsing or indexing is an option that allows the contents of a directory to be displayed in the browser when the directory does not contain an index page.
For example, if you make an http call to a directory such as http://yourdomain.com/images/, it would list all the images in that directory without the need for an html page with links.


We will need to create a blank file called “.htaccess”. You can name it “htaccess.txt” while your editing it, then rename the file to “.htaccess” after the file is on your web server.

Disable Directory Browsing or Indexing

Type or copy and past the following line of text in to your blank file.
Note: I add the work “All” so that every folder in that directory follows the same rule.

Options All -Indexes

Enable Directory Browsing or Indexing

You can reactivate it by adding the following line to your .htaccess file:

Options +Indexes

Once this is added, the directory will fully index again.

Tags: ,

Comments No Comments »

If mysql service is failing upon start, you will have to place the following code in /etc/my.cnf under ‘mysqld’ section and restart mysql service.

skip-innodb” (Do not add the quotes).

Tags: , ,

Comments No Comments »

There are 2 commands I like to use to see the number of connections of a Linux server.  These commands a useful in determing the traffic that is hiiting your server and also helps to see if you are being DDos’d. The basic command will show the ip’s connected to the server, but in no specific order and also does not display how many ip’s are connected at any given time on a port. You can change the port number as needed;

netstat -an |grep :80 |wc -l

The next command is golden. This will show the number of connections active to a port and will display the number of connections from that ip in order;

netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

Tags: , , ,

Comments No Comments »