Skip to content

Commit

Permalink
ENT-4149: Change reset administrative credentials documentation
Browse files Browse the repository at this point in the history
Do not overwrite email and roles in case if admin user exists

(cherry picked from commit 51bf6b4)
  • Loading branch information
aleksandrychev authored and nickanderson committed Jan 3, 2019
1 parent c8a93e5 commit 4ddb3c6
Showing 1 changed file with 3 additions and 10 deletions.
Expand Up @@ -10,18 +10,11 @@ The default `admin` user can be reset to defaults using the following SQL.
cfsettings-setadminpassword.sql:

```sql
UPDATE "users"
SET password='SHA=aa459b45ecf9816d472c2252af0b6c104f92a6faf2844547a03338e42e426f52',
salt='eWAbKQmxNP',
name='admin',
email='admin@organisation.com',
active='1',
roles='{admin,cf_remoteagent}',
changetimestamp = now()
WHERE username='admin';
INSERT INTO "users" ("username", "password", "salt", "name", "email", "external", "active", "roles", "changetimestamp")
SELECT 'admin', 'SHA=aa459b45ecf9816d472c2252af0b6c104f92a6faf2844547a03338e42e426f52', 'eWAbKQmxNP', 'admin', 'admin@organisation.com', false, '1', '{admin,cf_remoteagent}', now()
WHERE NOT EXISTS (SELECT 1 FROM users WHERE username='admin');
ON CONFLICT (username, external) DO UPDATE
SET password = 'SHA=aa459b45ecf9816d472c2252af0b6c104f92a6faf2844547a03338e42e426f52',
salt = 'eWAbKQmxNP';
```

To reset the CFEngine admin user run the following sql as root on your hub
Expand Down

0 comments on commit 4ddb3c6

Please sign in to comment.