NextCloud: Create User via CLI

2 views
HtmlToolWeb

As the NextCloud WebUI had a bug and didn't let me create new users I needed to find an alternative way to do so.
After some digging I found the following method to work and have been using it since:

Substitute[1]the 'www-data' user:
sudo su -s /bin/sh www-data
As this user, export the password for the new user to the 'OC_PASS' variable:
export OC_PASS=
Call the NextCloud/ownCloud command line tool 'occ' and create the user:
php /var/www/nextcloud/occ user:add --password-from-env --display-name="" --group="users"
Finally, stop substituting by typing: exit.

You should now see the newly created user in the NextCloud/ownCloud web interface.


  1. http://www.linfo.org/su.html ↩︎

bd5e475