Nextcloud Not Properly Creating nc_admin Account / Can't Login To Nextcloud

Okay, so this is a weird one, and absolutely needed to post it somewhere on the internet because one day someone will need it.

So lemme spin you a story, I run an Owncloud server, yesterday Owncloud was depreciated, and I was migrating over to Nextcloud. But here’s the problem, UMC never made an admin account for Nextcloud. So I went to users in UMC added my admin account, and tried to login. But was met with a login failure.

As it would turn out, UMC never created a working admin account for Nextcloud. Nextcloud did come with it’s default nc_admin account, but it was unusable, as it didn’t have a password, but requires a password on login (Makes sense right? Yeah, me neither).

So if you can’t login to your new Univention Nextcloud server/web interface let me tell you how to fix this.

Step 1
Open up your VM, we’re partying in Bash today. Get ready to have a lot of fun with it.

Step 2
Throw this into bash
sudo univention-app shell nextcloud

Step 3
Once you’re in bash, within nextcloud (You should be logged in as root@nextc-*******)
Run this

sudo chmod -R 775 /var/www/html
sudo chown -R www-data:www-data /var/www/html

Step 4
Verify you have an nc_admin account (You likely do, but we’re going to check just in case)

sudo -u www-data php occ user:list

Step 5
Change nc_admin’s password, password rules are at least 10 characters long (This is likely why UMC was never able to migrate my admin account over)

sudo -u www-data php occ user:resetpassword nc_admin

Once you’ve completed that, if you couldn’t login before with your UCS login, you should be able to login with nc_admin on the web interface for Nextcloud.

Like I said, it never migrated my admin account over like it was supposed to, because of the password thing. My UCS install is pretty damn old, so it’s only using an 8 character password, but the UMC is only accessible on lan, so I never needed to increase security.

A good fix for this that Univention should implement is a password check on install, or push out a bulletin that notifies users that their password policies may not match what certain apps require.

This was a huge pain in the ass for me to troubleshoot, but I absolutely felt the need to get it out there.

Granted, I had a ton of help from chat GPT helping me troubleshoot this stuff, it’s got a wealth of knowledge on Univention stuff, but yeah it didn’t have a direct path to this, we’ve been troubleshooting it for several hours.