Recovering Admin Password

Asked by Tom Hoffman on 2010-01-04

How do I recover or reset a lost admin password?

Question information

Language:
English Edit question
Status:
Solved
For:
SchoolTool Edit question
Assignee:
Justas Sadzevičius Edit question
Solved by:
Tom Hoffman
Solved:
2011-07-22
Last query:
2011-07-22
Last reply:
Whiteboard:
I'm pretty sure Ignas, and I worked this out, but that was a few years ago...
muchio (marius-gricius) said : #1

This issue is still important.
Please, implement password recovery procedure for ST users.

Regards,
Marius

Tom Hoffman (tom-hoffman) said : #2

Sorry we dropped the ball on your answer. Here it is:

As root, stop the server ("service schooltool stop" in a terminal) and
then enter this

python -m schooltool.app.main -c /etc/schooltool/standard/main.conf
--restore-manager PASS

Where PASS is the new password.

Then "service schooltool start" (and wait a minute for it to start).

muchio (marius-gricius) said : #3

Roger.

What if student forgets is/her password? How to recover in that case?

Cheers,
Marius

Tom Hoffman (tom-hoffman) said : #4

Oh, the manager can just navigate to the person's page and change their password.

muchio (marius-gricius) said : #5

Thanks a lot.

muchio (marius-gricius) said : #6

Thanks for clearing it out.
I suggest to add this instruction to official documentation page.

P.S. For ST 1.6 the reset command should be"

python -m schooltool.app.main -c /etc/schooltool/standard/schooltool.conf
--restore-manager PASS

where PASS is desired password for "manager".

sudhir gaikwad (zissshh) said : #7

sudhir@sudhir-desktop:~$ service schooltool stop
 * Stopping SchoolTool... Traceback (most recent call last):
  File "/usr/bin/paster", line 4, in <module>
    command.run()
  File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/python2.7/dist-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/lib/python2.7/dist-packages/paste/script/serve.py", line 137, in command
    self.options.set_user, self.options.set_group)
  File "/usr/lib/python2.7/dist-packages/paste/script/serve.py", line 501, in change_user_group
    os.setgid(gid)
OSError: [Errno 1] Operation not permitted
                                                                         [fail]
                                                                         [ OK ]
sudhir@sudhir-desktop:~$ python -m schooltool.app.main -c /etc/schooltool/standard/schooltool.conf

Reading configuration from /etc/schooltool/standard/schooltool.conf
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 787, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 784, in main
    StandaloneServer().main()
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 658, in main
    db = self.setup(options)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 670, in setup
    "%(asctime)s %(message)s")
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 299, in setUpLogger
    handler = UnicodeFileHandler(filename)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 275, in __init__
    stm = StreamWrapper(open(filename, 'a'))
IOError: [Errno 13] Permission denied: '/var/log/schooltool/error.log'
sudhir@sudhir-desktop:~$ --restore-manager PASS
--restore-manager: command not found
sudhir@sudhir-desktop:~$ python -m schooltool.app.main -c /etc/schooltool/standard/schooltool.conf
Reading configuration from /etc/schooltool/standard/schooltool.conf
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 787, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 784, in main
    StandaloneServer().main()
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 658, in main
    db = self.setup(options)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 670, in setup
    "%(asctime)s %(message)s")
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 299, in setUpLogger
    handler = UnicodeFileHandler(filename)
  File "/usr/lib/python2.7/dist-packages/schooltool/app/main.py", line 275, in __init__
    stm = StreamWrapper(open(filename, 'a'))
IOError: [Errno 13] Permission denied: '/var/log/schooltool/error.log'
sudhir@sudhir-desktop:~$ --restore-manager PASS
--restore-manager: command not found

WHAT DO I DO NEXT

muchio (marius-gricius) said : #8

You forgot to become root or use 'sudo' before each command.

Gediminas Paulauskas (menesis) said : #9

You need administrator rights for both commands, so prefix them with sudo.
Also, the restore password command has to be on one line (launchpad breaks lines on column 80); and PASS is the password you want to set.

sudo service schooltool stop

sudo python -m schooltool.app.main -c /etc/schooltool/standard/schooltool.conf --restore-manager PASS

sudhir gaikwad (zissshh) said : #10

sudhir@sudhir-desktop:~$ sudo service schooltool stop
[sudo] password for sudhir:
 * Stopping SchoolTool... [ OK ]
sudhir@sudhir-desktop:~$ sudo python -m schooltool.app.main -c /etc/schooltool/standard/schooltool.conf --restore-manager PASS
Reading configuration from /etc/schooltool/standard/schooltool.conf
Startup time: 35.588 sec real, 6.230 sec CPU
^Csudhir@sudhir-desktop:~$ ^C
sudhir@sudhir-desktop:~$
  IS THIS IT,,,,,

sudhir gaikwad (zissshh) said : #11

sudhir@sudhir-desktop:~$ sudo service schooltool start
 * Starting SchoolTool...

No ACCESS to the shooltool site,,,unable to connect

sudhir gaikwad (zissshh) said : #12

GOT it,,,,working,,,THANKS to ALL to PAy attention to my silly questions,,thanks for the software,,,count your blessings

Gediminas Paulauskas suggests this article as an answer to your question:
FAQ #1965: “Recovering Admin Password”.