Can't run sudo -u wwwrun

Hi

After last slowroll update I must to run nexctcloud’s occ command as wwwrun user with the following syntax sudo -u wwwrun php occ.
But the system prompts for wwwrun passwort which I don’t know and as far as I understand doesn’t exist at all because wwwrun is a system user.

sudo -u wwwrun php occ
[sudo] password for wwwrun:

What is a correct way to run occ command?

su wwwrun
Password: 
su: Authentication failure

No luck with runuser as well…

sudo runuser -l wwwrun -c 'php occ maintenance:repair --include-expensive'
This account is currently not available.

OK…
Finally I got it.

I have realized that while hardening my Nextcloud server I disabled root login
After changing the following lines in /etc/passwd
root:x:0:0:root:/root:/sbin/nologin
to
root:x:0:0:root:/root:/bin/bash
and
wwwrun:x:470:470:WWW daemon apache:/var/lib/wwwrun:/usr/sbin/nologin
to
wwwrun:x:470:470:WWW daemon apache:/var/lib/wwwrun:/bin/bash

I have been able to run runuser -l wwwrun as well as su - which

On the second thought, there is no need to allow root login as long as one use runuser -l wwwrun.
It is enough to temporary allow login for wwwrun user in /etc/passwd

wwwrun:x:470:470:WWW daemon apache:/var/lib/wwwrun:/bin/bash

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.