How to defend a virtual private server from hackers

24 Nov, 2009

form email
Email forms are a common way for hackers to send spam. If you use email forms such as Matt’s script (often known as FormMail) or other similar mail scripts, your server could be vulnerable to attacks. If you have clients or simply other users creating sites on your server, you might not even know if you have these scripts. To find out, you can run this simple command:

find / -name “[Ff]orm[mM]ai*”

To check for CGIemail scripts, try this command:

find / -name “[Cc]giemai*”

Finally, to disable the sending of emails from the forms, enter:

chmod a-rwx /path/to/filename

This last command will completely lock user permissions to the script, so if you have a customer or user of a VPS who utilizes one of these form scripts, be sure to contact them and give them ample warning before proceeding. You should offer them a safe and secure alternative, leaving your customers happy and your server secure.

Photo: Flickr

(0) Comment Categories : VPS & Dedicated, Web Hosting, Web servers
Tag: , , , , ,

Managing passwords in Linux with the "passwd" command

6 Nov, 2009

Root password
When managing a dedicated server, it is very important to keep a secure password and to change it periodically. In an SSH session, the best way to accomplish this is to use the “passwd” command. A normal user can change his/her own account, while a system administrator (root) can change any account’s password on the system.

In Linux, there are certain requirements for passwords. The “passwd” command is configured to reject passwords that appear to be too easy to guess, particularly those that match common usage words. To change the password of the current user, just type passwd with nothing following it. To change the password of any other user, log in as root and then enter:

passwd username

It will ask you for a new password and then ask you to type the password again to confirm it. A good password will be 6 to 8 character and contain both lowercase letters and numbers. Another trick you can use to make sure a user changes his or her password is to use the “-e” flag. Enter:

passwd -e username

This will cause the user’s password to expire and force the person to change the password at his/her next login.

Photo Source: Flickr

(0) Comment Categories : VPS & Dedicated, Web Hosting, Web servers
Tag: , , , , ,

What is root and su?

6 Oct, 2009

the matrix is root
Question: What is root and su?

Answer: On Linux and other Unix-like systems, root is the default username of the system administrator or super user (su). Typically, the root user is the only one that has complete read and write access on every file located on a server. Shared hosting accounts never allow root access, but if you are using a self-managed dedicated hosting service, you will probably need root access.

It is very unwise to login to your server directly as root. The more secure method is to login as a regular user with default permissions and then gain root access through the user. On Linux systems, you typically gain root access by typing “su” and then entering the password when prompted; however, some servers use sudo.

With sudo, you do not login directly as root. Instead, anytime you need to execute a root command, you put “sudo” in front of it. So, to remove a file, you would type “sudo rm filename”. It would then prompt you for the password. There has always been an ongoing to debate about which is more secure. With either method you need to be careful. Root has full access to your server. Use it wisely.

(0) Comment Categories : Security, Web servers
Tag: , , , , ,