nkakouros-original / ansible-role-nextcloud

An Ansible role to install Nextcloud
GNU General Public License v3.0
11 stars 5 forks source link

Set up bash completion for occ #6

Open nkakouros opened 6 years ago

simonspa commented 4 years ago

This is something I can't even get to work manually. I guess the culprit is that www-data needs to have a profile, as noted in the docs:

Command autocompletion currently only works if the user you use to execute the occ commands has a profile. www-data in most cases is nologon and therefor cannot use this feature.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#enabling-autocompletion

I'd be very hesitant to change that user account...

nkakouros commented 4 years ago

What we could do is:

Then, if the user wants to work with the occ tool, they can do:

sudo su www-data -l -s /bin/bash

And they will have autocompletion. We could mention this in the README.

simonspa commented 4 years ago
sudo su www-data -l -s /bin/bash

<- that's exactly the problem - www-data is a user without profile, so we cannot su into it because it can never open a terminal session:

# sudo su www-data
This account is currently not available.
nkakouros commented 4 years ago

If you supply -s /bin/bash then it will use a shell for the www-data user to use.