Posts

Showing posts from May, 2009

Adding Swap File to Currently Installed Ubuntu OS

1. Create a file with a size you prefer.

# sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512

2. Format the created file

# sudo mkswap /mnt/512Mb.swap

3. Add the swap to the running system.

# sudo swapon /mnt/512Mb.swap

to check if the swap file has been activated use # cat /proc/meminfo or # free -t

4. To make the swap permanent every other boot.

# gksudo gedit /etc/fstab

Add the line at the end of the file

/mnt/512Mb.swap none swap sw 0 0

5. Save and reboot the system.

source: help.ubuntu

Testing Radiator Radius via PHP Client

1. Install Apache and PHP with radius module.

reference :
http://freeradius.org/mod_auth_radius/

(XAMPP Package has pre-installed radius module, you can use this for alternative installation)

2. Create a PHP script for the authentication test, use the content below.

<html>
<head><title>RSA Test</title></head>
<body bgcolor=#ffc7 text=#000000>
<?php
$challenge = false;
$loginAccepted = false;
$error = false;

if (isset($_POST['uname'])) {
$radius = radius_auth_open();

if (!radius_add_server($radius,'[IP ADDRESS]',[PORT],'[secret]',60,1)) {
$error = radius_strerror($radius);
} else if (!radius_create_request($radius,RADIUS_ACCESS_REQUEST)) {
$error = radius_strerror($radius);
} else {

radius_put_attr($radius,RADIUS_USER_NAME,$_POST['uname']);
if (isset($_POST['challenge'])) {
radius_put_attr($radius,RADIUS_USER_PASSWORD,$_POST['challenge']);
radius_put_…