by Ken Task.
If typical Ubuntu 14.0 apache web root is in /var/www/html/ Moodle code would be in there.
Evidence of that is the presence of a config.php file ... so logged on a root user or sudo -s
ls /var/www/html/config.php
IF it says file not find then you have some sluething to do about your system.
IF it does show config.php exist there, then do the following:
cd /var/www/html/admin/cli/
The script is called 'reset_password.php'. It will change the password of manual accounts only. Typically there are three such accounts: guest ... which is ID 1, the initial admin user that installed the system, ID 2 and if the installer used the default login, then it is 'admin' and hopefully a third account ... yours.
from the location given above, type:
php reset_password.php
You will be prompted for the account login whose password you desire to reset.
If the script finds the account, you will then be prompted to provide the password in clear text ... meaning you will be able to see what you've typed.
IF the moodle has character requirements for password, you will need to provide a password that passes muster.
If you get the password changed successfully, stay at that location in terminal session, open browser, and see if you can login.
Recommendation: get to know your Ubuntu system from the command line. That knowledge will save your 'hinie' many times.
'spirit of sharing', Ken