Search
Archives

You are currently browsing the archives for the Server Management category.

Archive for the ‘Server Management’ Category

Add newly assigned IP addresses

To add newly assigned IP addresses from SSH, follow this procedure:

(Please follow the steps given below only on a Centos / Fedora.)

  • Login to your server with SSH as root.
  • Go to the /etc/sysconfig/network-scripts directory.
cd  /etc/sysconfig/network-scripts/
  • Verify which interface you will use to add IP addresses. Typically, this will be eth0 for public IP addresses.

/sbin/ifconfig

  • Make a copy of ifcfg-eth0 for each IP you wish to add and name them as ifcfg-eth0:0, ifcfg-eth0:1 etc.
cp ifcfg-eth0 ifcfg-eth0:0 
cp ifcfg-eth0 ifcfg-eth0:1 
cp ifcfg-eth0 ifcfg-eth0:2 
cp ifcfg-eth0 ifcfg-eth0:3 
cp ifcfg-eth0 ifcfg-eth0:4
  • Open each of them and change the fields DEVICE, .IPADDR and NETMASK accordingly.
  • Restart the network:
/etc/init.d/network restart

Disable Password Authentication

Disable Password Auth, Follow these steps….

Once you have SSH Keys configured, you can add some extra security to your server by disabling password authentication for SSH. (Note that if you do lose your private key, this will make the server inaccessible and you will need to contact your host to have this re-enabled.)

To disable this setting, you can do the following:

nano /etc/ssh/sshd_config

In this file, set the following settings to the following values. If these settings are already in the file, set them to “no” rather than add new lines.

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Once this is done, restart the SSH daemon to apply the settings.

/etc/init.d/sshd restart

Save a Public Key on your Centos Server or VPS

Save a Public Key on your Centos Server or VPS

  1. Log in to your destination server
  2. If your SSH folder does not yet exist, create it manually:

mkdir ~/.ssh

chmod 0700 ~/.ssh

touch ~/.ssh/authorized_keys

chmod 0644 ~/.ssh/authorized_keys

Installing Proftpd on CentOS 5.4, 5.5 or 5.x

So I’ve been testing out webmin which is a free control panel for linux servers on one of my VPSs’ and I wanted to install an FTP server. Problem was this.. when I tried to run the proftpd module in webmin, it couldn’t find the proftpd rpm package to install on CentOS. So what did I do? Yes, google is the devil. I googled it. Found a website that explained how to do it but I can’t remember the website, I just remembered saving the command to install proftpd on CentOS. Hope this helps someone else out there

Do the following:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Then do the following:

yum install proftpd

and that should install proftpd so you can administer it via webmin 🙂

Good luck!

Changing the default SSH port on your VPS – CentOS 5

This is not in anyway a game changer when it comes to security. But, by simply changing your SSH port you can cut down on over 95% of automated brute force attempts. By default SSH utilizes the port 22; here’s how to change it:

Login into SSH and edit the sshd_config file which is located in /etc/ssh/.

    nano /etc/ssh/sshd_config

If you prefer to use vi, then simply change nano to vi.

Scroll down until you see the following line:

    #Port 22

Delete the # symbol and change the 22 to a different port to your liking. It should look like this:

    Port 5757

Save the file (CTRL-X), Y, and then enter. Finally, you just need to restart SSH

    service sshd reload

That’s it! Next time you SSH into your server, be sure to utilize the port 5757 instead of 22.

Test the Disk I/O of your VPS

There are a few commands that allow you to test the disk I/O speeds on your virtual machine. Please note that scores do vary and are not a completely accurate assessment of disk I/O.

hdparm -t /dev/sda1

Example output:

    [root@server~]# hdparm -t /dev/sda1
    /dev/sda1: Timing buffered disk reads: 1158 MB in 3.01 seconds = 385.34 MB/sec
    [root@server~]#

dd if=/dev/zero of=/tmp/test bs=64k count=16k conv=fdatasync

Example output:

    [root@server~]# dd if=/dev/zero of=/tmp/test bs=64k count=16k conv=fdatasync
    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 4.89845 seconds, 219 MB/s
    [root@server~]#

There is an ongoing thread posted on WebHostingTalk which will allow you to compare your score.