Jaime Frutos Morales's blog

17/03/2010

How to disable IPv6 on Ubuntu Server 9.10

Filed under: SysAdmin, Ubuntu — acidborg @ 17:21

IPv6 support can be disabled on Ubuntu Server 9.10 following these simple steps:

  1. Edit /etc/default/grub :
    GRUB_CMDLINE_LINUX="ipv6.disable=1"
  2. Update GRUB: update-grub2 (or update-grub if you don’t use GRUB 2)
  3. After the next reboot, IPv6 support will be disabled.

12/03/2010

How to specify the listening ports of a NFS server on Red Hat 5

Filed under: Security, SysAdmin — acidborg @ 14:39

Description: by default, some NFS (both version 2 and 3) daemons on Red Hat 5 listen on random ports (statd, lockd, mountd, rquotad). In order to configure a firewall for this daemons, the incoming ports need to be fixed and not random. I’m going to use the following ports in this example: 4000 for statd, 4001 for lockd, 4002 for mountd and 4003 for rquotad.

Steps:

  1. Edit /etc/sysconfig/nfs with this configuration:
    • STATD_PORT=4000
    • LOCKD_TCPPORT=4001
    • LOCKD_UDPPORT=4001
    • MOUNTD_PORT=4002
    • RQUOTAD_PORT=4003
  2. Restart your NFS server: service nfs restart ; service nfslock restart
  3. Configure your firewall rules to allow NFS traffic to this ports.

02/03/2010

How to rebuild a corrupted RPM database in Red Hat Linux

Filed under: Linux, SysAdmin — acidborg @ 18:42

Description: If your system’s RPM database is corrupted, you can try this short recipe to rebuild it before trying to restore it from a backup (NOTE: don’t forget to make a backup of the /var/lib/rpm directory periodically on every Red Hat Linux system!).

Steps:

  1. Remove RPM’s locks (if present): rm -f /var/lib/rpm/__db*
  2. Rebuild RPM’s database: rpm -vv --rebuilddb
  3. Check if it worked: yum update

If this didn’t work, then restore from your backup.

Create a free website or blog at WordPress.com.