Skip to content

PAM error when Plinth tries to run sudo commands

[2018-05-03 10:11:50,946] django.request ERROR    Internal Server Error: /plinth/accounts/sso/login/
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/plinth/modules/sso/views.py", line 68, in dispatch
    return set_ticket_cookie(request.user, response)
  File "/usr/lib/python3/dist-packages/plinth/modules/sso/views.py", line 50, in set_ticket_cookie
    private_key_file, '--tokens', ','.join(tokens)
  File "/usr/lib/python3/dist-packages/plinth/actions.py", line 118, in superuser_run
    log_error=log_error)
  File "/usr/lib/python3/dist-packages/plinth/actions.py", line 190, in _run
    raise ActionError(action, output, error)
plinth.errors.ActionError: ('auth-pubtkt', '', 'sudo: PAM account management error: Permission denied\n')
[2018-05-03 10:15:54,747] django.security.csrf WARNING  Forbidden (Referer checking failed - no Referer.): /plinth/accounts/sso/login/
[2018-05-03 10:20:08,215] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/auth-pubtkt', 'generate-ticket', '--uid', 'joseph', '--private-key-file', '/etc/apache2/auth-pubtkt-keys/privkey.pem', '--tokens', 'admin']
[2018-05-03 10:20:08,341] plinth.actions ERROR    Error executing command - ['sudo', '-n', '/usr/share/plinth/actions/auth-pubtkt', 'generate-ticket', '--uid', 'joseph', '--private-key-file', '/etc/apache2/auth-pubtkt-keys/privkey.pem', '--tokens', 'admin'], , sudo: PAM account management error: Permission denied