Owncloud: How to change the admin password from the command line.

I’ve been playing with Owncloud in a Docker container today and something was not set right. The admin password was not the default one. So my options were to delete the sqlite db file or run some password generating commands and queries to update the password.

The first thing is to generate a new sha1 password:

echo -n "password" | sha1sum

Use the result from the command above as the new password.

The second thing is to open the sqlite database with the sqlite3 command and update the admin’s password:

cd /var/www/owncloud/data
sqlite3 owncloud.db
update oc_users set password = "newsha1password" where uid = "admin";
.quit

Now you can login normally with admin/newpassword and from there you can set up all of the rest.

The sources I used for this article: here and here.

Your first app: node.js by Jim Schubert

I started reading the book "Your first app: node.js" by Jim Schubert.It has a good ...

Learn more

About Iliyan Trifonov

Web Developer, Blogger
Tagged , , , . Bookmark the permalink.