Install Apache radius module :

1 apt-get install libapache2-mod-auth-radius

enable radius module for Apache :

1 a2enmod auth_radius

open /etc/apache2/apache2.conf and add the following lines to end of file :

1 AddRadiusAuth IP_OF_RADIUS_SERVER:PORT SECRET 5
2 AddRadiusCookieValid 60

go to /var/www folder or the folder which you want to protect and create a .htaccess file inside it containing following lines :

1 AuthType Basic
2 AuthName "AdminseHow Radius Authentication"
3 AuthBasicAuthoritative Off
4 AuthBasicProvider radius
5 AuthRadiusAuthoritative on
6 AuthRadiusActive On
7 Require valid-user

restart Apache :

1 /etc/init.d/apache2 restart

for more info regarding the configuration options , you can read the following link :
http://freeradius.org/mod_auth_radius/

source here

With FreeRADIUS+MySQL installed, it’s now turn to install daloRADIUS; a web-based management system for FreeRADIUS.  Before installation, ensure that Apache, PHP and MySQL have been installed and running.  You’ll need PHP PEAR as well.  Use the following command to install the required libs:

# apt-get install php-pear
# pear install DB

Get the latest version of daloRADIUS from http://sourceforge.net/projects/daloradius/files/.  Extract the tarball to /var/www/daloradius.  You’ll need to import daloRADIUS DB schema from /var/www/daloradius/contrib/db/mysql-daloradius.sql:

# mysql -u root -p radius < mysql-daloradius.sql

Even after importing the schema, there seems to be a missing table i.e. usergroup.  Get the missing table schema from fr1-mysql-freeradius.sql in the same directory.  Once the table has been imported, edit the /var/www/daloradius/library/daloradius.conf.php for DB access credentials.

Access the daloRADIUS installation via a web browser at http://<hostname>/daloradius.  Login as administrator/radius.

You should now have a working daloRADIUS installation.

source here

Here’s a *near* step-by-step guide to setup FreeRADIUS with MySQL backed authentication done on Ubuntu 9.10 (Karmic).  Start by installing the necessary deb files:

# apt-get install freeradius freeradius-mysql

Add the following lines to the /etc/freeradius/users file:

abc     Cleartext-Password := “123″

Stop freeradius service just in case:

/etc/init.d/freeradius stop

Now test using the radtest client:

# radtest abc 123 localhost 1812 testing123
Sending Access-Request of id 149 to 127.0.0.1 port 1812
User-Name = “abc”
User-Password = “123″
NAS-IP-Address = 208.67.219.132
NAS-Port = 1812
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=149, length=20

Ensure that the response is “Access-Accept”.  The following should be displayed at the server console: Read the rest of this entry »

How To: DPKG guide   July 1st, 2009

This tutorial will bring you through dpkg, the debian package manager. As I introduce apt, I will now introduce dpkg and show how to search which files are installed by a package, which packages are installed on your system ….

Search packages containing a file:

It happens quite often that you use binaries and want to know which package contains it. Let’s take the example of gaim, searching file containing bin/gaim will look like this:

$dpkg -S bin/gaim
gaim: /usr/bin/gaim
gaim: /usr/bin/gaim-send
gaim: /usr/bin/gaim-remote.py
gaim: /usr/bin/gaim-client-example
gaim: /usr/bin/gaim-send-async
gaim: /usr/bin/gaim-notifications-example.py

Getting installed package:

searching for packages intalled on your system which are named gaimsomething is achieved by triggering the following command:

$ dpkg –get-selections ‘gaim*’
gaim install
gaim-data install
gaim-dev install
gaim-xmms-remote purge

This actually give you the packages named like as well as their status (install|deinstall|purge), install stands for installed on your system ;) , deinstall means that the package has been removed but that the configuration files were kept, and purge means that the package was deinstalled plus all the configuration files coming along with.
Getting installed versions:

When a package is installed on your system, you might want to know which version it is. In the following example, the gaim version is 2.0.0.0beta3 and the debian revision 2ubuntu0, a brief summary of the package comes with as well as the package’state (ii,un,pn..):

$ dpkg -l ‘gaim*’
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================-===================-===================================================
ii gaim 2.0.0beta3-2ubuntu0 multi-protocol instant messaging client un gaim-common (no description available)
ii gaim-data 2.0.0beta3-2ubuntu0 multi-protocol instant messaging client – data files
ii gaim-dev 2.0.0beta3-2ubuntu0 multi-protocol instant messaging client – development files
un gaim-gnome (no description available)
pn gaim-xmms-remote

Getting all files installed by a package:

Once a package is installed, you can get all the files installed by that package by trigerring the following command line:

$dpkg -l gaim

This can be pretty usefull to locate the configuration files of a software.

Getting the status of a package:

Finally, you can get the status of a package with the -s switch, this will output the state of the package along with the list of package it depends on, plus the description of the package.

$dpkg -s gaim

Hope this helps :) ,

Cheers

Thanks to Author, orignal link http://www.debuntu.org/2006/06/06/57-how-to-dpkg-guide

Screen is a must known GNU console tool, this small piece of software comes really handy when you are working on a console or sending long processes on a remote host.

When you start screen, you simply get a terminal prompt, but then, many features are given to you. Most users don’t even know about it, but you will soon love it.

From GNU:

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

Along this tutorial, we are going to start a screen session and start different windows. Then we will see how to use the some essential features from screen, such as naming windows, navigating from window to window.

Mind that key binding will be written in bold and that it is case sensitive, where Ctrl-x y means pression Control and x simultaneously.

Installation:

As usual, before using softwares, you need it to be install on your system. In order to install screen on a debian based system, you need to:

$sudo apt-get install screen

Starting a screen session, dettaching and reattaching it:

Now that everything is up, let’s start your first screen instance giving it the name screen-session:

$screen -S screen-session

As you can see, you get a new prompt inside the previous terminal. Let’s start a program inside this shell, irssi -c irc.debian.org for instance.

$irssi -c irc.debian.org

Okie, once logged in, join a channel (/j #debian) and detached the session (Ctrl-a d). You are getting back to your previous shell and told that the session is [detached].

You can go back to your screen session by attaching the session back:

$screen -x screen-session

As you can see, the irc session is still running on :) .

Creating more windows:

screen can actually handle more than one window per session. In order to create a new window, type Ctrl-a c keybinding, you then get a new prompt, let start top in that window:

$top

And again a new window, Ctrl-a c where you will start for instance nload (a network traffic analysis software):

$nload

Navigating through windows:

There is a lot of things you can do now:

     

  • Going to the next window (Ctrl-a n) or previous window (Ctrl-a p). 
  • Getting the number and name of the current window (Ctrl-a N), check at the bottom left. 
  • Go to window X (Ctrl-a X) where X is the window number, therefore Ctrl-a 0 to go to the first window you created. 
  • Rename a window (Ctrl-a A) 
  • Get a listing of all the windows (Ctrl-a “), you can then move up and down using the keyboard arrows and go to a specific window by pressing Enter. 

Example:

Now, let’s see how it goes using the windows we created. We are going to give them all a name, and switch windows.

First, we are going back to the first window we created when we launched screen. So, let’s go by typing Ctrl-a 0 and as we are running irssi on debian channel, we we call it “irc debian”. In order to do this, we need to use the keybinding Ctrl-a A and then remove the elder name and type “irc debian” instead.

Going back to the windows list Ctrl-a “ will now show window 0 called debian irc and windows 1 and 2 named bash. Go to the last one (#2) and select it Enter. This window is running nload, so let’s call it “nload” [Ctrl-a A].

Now, switch to the previous window [Ctrl-a p], and rename it “top” [Ctrl-a A], back to the windows list [Ctrl-a "], this is now much easier to find the window you started ;) .

Conclusion:

screen allow system administrators and console fans to get more from their terminal as you can easily start windows are find them back by giving them appropriate names.

Another usefull feature of screen is to be able to connect to a remote server, start a screen session, detach the session and then close the ssh connection. Later on, you can connect back to the remote host and attach back the screen session you started earlier on.

People who want to know more about screen my refer to man screen or Ctrl-a ? from within a screen session.

Enjoy it ;)

Thanks to Author, orignal link http://www.debuntu.org/2006/07/04/72-how-to-screen-the-ultimate-admin-tool