[CentOS] Running commands as apache user

Sat Aug 8 08:49:23 UTC 2020
J Martin Rushton <martinrushton56 at btinternet.com>

On 08/08/2020 01:01, H wrote:
> On 08/07/2020 07:56 PM, H wrote:
>> I have a dilemma: I have nextcloud running under user and group apache, as recommended by the installation. I now have to run some nextcloud commands but even as root I cannot su to user apache because "this account is currently not available". Is there a way around this? The commands must be run as user apache...
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> https://lists.centos.org/mailman/listinfo/centos
> 
> Fixed. I found "su -l apache -s /bin/bash" on the web which allows me to get around the nologin.
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 

A little suggestion to you - edit /etc/nologin.txt to read:

This account is currently not available.  Try: # su -l <user> -s /bin/bash

Make sure the file is set to 644 and it will prompt you if you forget 
the syntax.

-- 
J Martin Rushton MBCS