I am using this module to authenticate using pam: http://code.google.com/p/web2py/source/browse/gluon/contrib/pam.py
I can call authenticate(\'username\',\'password\
I had the same issue root was not getting authenticated. here is the fix
If you use the service 'login' it wont work for root. use,
#authenticate('username','password',service='system-auth')