Admin account – User Disabled & using PuTTY

Hello Experts!
After few upgrades/updates/addons, I am not able to access my admin account,
I get an error saying user disabled.
I am also looking for instructions on how to connect using PuTTY, so I can copy paste easily.

My Installation
Windows Server
Oracle VM VirtualBox
ubuntu 20.04.1 LTS
Nextcloud 20.0.8.1 (Latest patch level, Major version still supported)

Things I tried, which didn’t work:
sudo -u www-data php occ user:resetpassword admin_username
sudo: php: command not found

Thanks,

Hello @sumitu ,

please use the internet to solve such questions.

Search the forum and you will get answers. Hint: Use the full path to your php binary.

Why resetting password if user is disabled? See occ command docs and just enable it again.

1 Like

Hello @sumitu

How are you doing?

Did you tried to run “sudo -u www-data php /the/path/to/nextcloud/occ user:resetpassword admin_username” ?

Example (In my case the httpd user is “apache” and not “www-data”):
1) Just to make sure about the correct username of the admin I ran:
sudo -u apache php /var/www/html/nextcloud/occ user:list

2) Then, I saw that my admin username is “Administrator”, so I ran:
sudo -u apache php /var/www/html/nextcloud/occ user:resetpassword Administrator

For that Putty issue:
There’s no problem about using Putty to connect via SSH, but since Windows 10 1803 (About 3 years ago) you can connect directly from cmd using:
ssh linux_user@linux_ip

Example:
ssh juliano@192.168.0.10

Hope you can resolve this, good luck mate!

:smiley:

1 Like

I am not sure where my occ is located, I tried running
sudo find / -name “occ”

/snap/Nextcloud/26119/bin/occ
/snap/Nextcloud/26119/htdocs/occ
/snap/Nextcloud/27089/htdocs/occ
/usr/src/linux-headers-5.4.0-70/drivers/hwmon/occ
/usr/src/linux-headers-5.4.0-71/drivers/hwmon/occ

I don’t seem to have a www folder under /var.

thanks rakekniven - been searching the forums, didnt find a solution so far, hence posted it here.

So, I have successfully reset the password for admin account using below:

cd /var/snap/nextcloud
sudo nextcloud.occ user:resetpassword username

but when I try to login I still get User disabled error.

Thank you guys, this worked !

sudo nextcloud.occ user:enable username

2 Likes

Yes, that’s exactly how you ran it.

I didn’t see that you was running a snap installation.

Congratulations mate! Nice work.

:smiley:

1 Like