Browsing the blog archives for December, 2014.

Apt-get update error

linux, server

As Debian big fan, sometime I found that apt-get update command reveal this error:
“E: Some index files failed to download. They have been ignored, or old ones used instead.”

This command is very simple solution I found:

# rm /var/lib/apt/lists/partial/*

After that, apt-get update && apt-get upgrade command should be fine.


Comments Off on Apt-get update error

Clean /boot Partition in CentOS 6

linux, server

/boot Partition in CentOS 6 can be cleaned by removing old kernels.

These are the steps:

1. Check /boot partition (98% used)

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        93M   86M  2.1M  98% /boot

2. Check installed kernel

# rpm -q kernel

3. Install package-cleanup

# yum install yum-utils
# package-cleanup --oldkernels --count=2
 Package              Arch                 Version                        Repository                                              Size
 kernel               x86_64               2.6.32-431.el6                 @anaconda-CentOS-201311272149.x86_64/6.5               121 M

Transaction Summary
Remove        1 Package(s)

Installed size: 121 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : kernel-2.6.32-431.el6.x86_64                                                                                        1/1 
  Verifying  : kernel-2.6.32-431.el6.x86_64                                                                                        1/1 

  kernel.x86_64 0:2.6.32-431.el6                                                                                                       


4. Check /boot partition (67% used)

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        93M   59M   30M  67% /boot

5. Limit only 2 latest kernel for later updates

# vim /etc/yum.conf
   ...[edit yum.conf]...
   ...[edit yum.conf]...


Comments Off on Clean /boot Partition in CentOS 6

SSH Server Administration

linux, server

Having several Linux Servers, SSH access is mandatory communication between me and those servers. These are several tips for SSH Server administration that save the day:

Add these line on /etc/ssh/sshd_config:

  • Allow only specific user (never use root login for remote SSH access)
    AllowUsers username
    DenyUsers All
  • Disable DNS and GSSAPI (solving slow login respond, especially from private network)
    UseDNS no
    GSSAPIAuthentication no

Make sure to restart SSH service after changing sshd_config:

# service ssh restart


# /etc/init.d/ssh restart

Additional tip:

  • Add this options on /etc/resolv.conf (solving slow login respond on RHEL/CentOS)
options single-request-reopen


Comments Off on SSH Server Administration