Basic Samba for CentOS

The following is a basic how-to guide for setting up Samba file sharing on CentOS. This is meant to be a simple introduction and does not include options for integrating Samba authentication with LDAP or Active Directory.

Check and see if samba is installed or not:

# rpm -qa samba

If it is not installed, then install using:

# yum install samba

# yum install samba-common

# yum install samba-client

# yum install system-config-samba

Samba configuration file is /etc/samba/smb.conf. Continue reading “Basic Samba for CentOS”

Find Dell Service Tags in Windows and Linux

From time to time its necessary to have the Dell Service tag for a server in order to download updated software, drivers and to request onsite service in the event of a hardware failure. The Dell Support Site shows the physical location of the service tag and express code stickers for various Dell hardware models.

In the event you don’t have physical access to a server you can request the service tag at the OS level using the following commands for Linux and Windows:

Windows Systems

Login to the Windows remote-host using Remote Desktop or VNC then use the Windows Management Instrumentation (WMIC) to quiery the service tag:

C:\>wmic bios get serialnumber
SerialNumber
ZZDDEE7

Following WMIC syntax will provide the service tag along with the model number of the server:

C:\>wmic csproduct get vendor,name,identifyingnumberIdentifyingNumber    Name                Vendor
ZZDDEE7              PowerEdge R710      Dell Inc.

Alternatively, you can remotely query the Service Tag of a remote server as long as you have login credentials available to you:

C:\>wmic /user:administrator /node:remote-host bios get serialnumber
SerialNumber
ZZDDEE7

Linux Systems

Login to the remote Linux server using SSH then use dmidecode to query the service tag:

[server]# dmidecode -s system-serial-number
ZZDDEE7

Alternatives for Linux are outlined here.

How to Install PHP 5.3.3 on CentOS 5.x / 6.x

PHP: Hypertext Preprocessor is a widely used, free and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML. PHP applications are commonly found with the filename extensions .php, .php4, or .php5.

This guide will outline the process of installing (or upgrading to) PHP 5.3.3 on CentOS 5.x and 6.x operating system versions:

[[email protected] ~]# yum install php53-* -y

Transaction Summary
====================================================================================================
Install 58 Package(s)
Upgrade 0 Package(s)

Total download size: 24 M
Downloading Packages:
(1/58): php53-recode-5.3.3-1.el5.i386.rpm | 5.9 kB 00:00
(2/58): firebird-filesystem-2.1.4.18393.0-1.el5.i386.rpm | 6.6 kB 00:00
(3/58): php53-enchant-5.3.3-1.el5.i386.rpm | 9.7 kB 00:00
(4/58): php53-mcrypt-5.3.3-1.el5.i386.rpm | 16 kB 00:00
(5/58): php53-tidy-5.3.3-1.el5.i386.rpm | 18 kB 00:00
(6/58): php53-php-gettext-1.0.11-3.el5.noarch.rpm | 20 kB 00:00
(7/58): zarafa-common-7.0.6-1.el5.i386.rpm | 21 kB 00:00
(8/58): boost141-system-1.41.0-2.el5.i386.rpm | 24 kB 00:00
(9/58): php53-pspell-5.3.3-7.el5_8.i386.rpm | 26 kB 00:00
(10/58): php53-mssql-5.3.3-1.el5.i386.rpm | 26 kB 00:00 Continue reading "How to Install PHP 5.3.3 on CentOS 5.x / 6.x"

Untangle Captive Portal Customization

The Untangle Unified Threat Management (UTM) system includes a Captive Portal which can be useful for managing and restricting access on a wireless hotspot.

The Captive Portal can be customized to include your own logo, portal icon, login button and favorite icon by modifying the following files:

1. Branding Logo - /var/www/images/BrandingLogo.gif

2. Captive Portal Favicon – /var/www/images/favicon-captive-portal.png

3. Captive Portal Icon – /var/www/skins/default/images/user/icon_captive_portal.png

4. Green Login button – /var/www/skins/default/images/user/green-button-background-3.gif

5. Green Login button (mouseover) – /var/www/skins/default/images/user/green-button-background-3_f2.gif

These files can be modified by uploading replacement images via SFTP. I recommend renaming the original so that you have a backup in case of any issues.

Once you have uploaded the edited images use the “View Page” feature within the Untangle management interface to test the page.

Blocking Bit Torrent with IPTABLES

To block Bit Torrent traffic with IPTABLES you can edit /etc/sysconfig/iptables (CentOS) and include the following:

# Torrent ALGO Strings using Boyer-Moore
-A RH-Firewall-1-INPUT -m string --algo bm --string "BitTorrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "BitTorrent protocol" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "peer_id=" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".torrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "announce.php?passkey=" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "torrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "announce" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "info_hash" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "/default.ida?" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".exe?/c+dir" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".exe?/c_tftp" -j DROP

# Torrent Keys
-A RH-Firewall-1-INPUT -m string --string "peer_id" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "BitTorrent" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "BitTorrent protocol" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "bittorrent-announce" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce.php?passkey=" --algo kmp -j DROP

# Distributed Hash Table (DHT) Keywords
-A RH-Firewall-1-INPUT -m string --string "find_node" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "info_hash" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "get_peers" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce_peers" --algo kmp -j DROP

For more information regarding IPTABLES options visit http://linux.die.net/man/8/iptables.