A simple trick is to send the user (with user_id) a link (by mail or any other way)
You can do something like this (max_time is when you want the key to expire)
user = db.auth_user(user_id)
reset_password_key = str(int(max_time)) + '-' + web2py_uuid()
user.update_record(reset_password_key=reset_password_key)
link =auth.url(auth.settings.function,
args=('reset_password', reset_password_key),
scheme='https')
You can put this in a file .py and call it from web2py.py using the -R option on commandline.