Grafana-cli admin reset-admin-password access is denied - grafana

I'm running grafana locally on my windows 10 computer using the grafana-8.0.2.windows-amd64 installer.
I'm having issues resetting my password - username: admin password: admin doesn't work and I don't remember what I set it to. I've navigated to the /GrafanaLabs/grafana/bin/ folder in the command prompt and run the command: grafana-cli admin reset-admin-password 'admin'
which returns ←[31mError←[0m: ←[31m✗←[0m failed to load configuration: failed to initialize file handler: open C:\Program Files\GrafanaLabs\grafana\data\log\grafana.log: Access is denied.
I've read so many potential solutions and tried the SQLite one referenced here - https://community.grafana.com/t/how-do-i-reset-admin-password/23/2 and while this doesn't give me an error message, it does not allow me to log in even after restarting the Grafana in "Services" through the OS.

Very simply, you need to run the command prompt as an administrator. The above instructions will work as is but the password will literally be 'admin' rather than admin. Use double quotes if you wish to have spaces in your password as shown below.
grafana-cli admin reset-admin-password "admin password"

Related

Can't create user for ceph dashboard

I'm trying to create a user for ceph dashboard with admin role. Version is Nautilus 14.2.19 and deployed with manuel installation.
I've installed dashboard module, installed all dependencies and enabled it. My dashboard is reachable from the monitor ip and default port of 8443.
When I run te command:
ceph dashboard ac-user-create <user> <pw> administrator
I get the following error:
Please specify the file containing the password/secret with "-i" option.
After digging for information about this it says there must be a file in bcrypt format. Is there a default created file for this? Or if it's needed to create one how can I do it?
Nevermind, it seems you just need to create a text file and write your password in it.
When you run the command like this:
ceph dashboard ac-user-create <user> -i /file/location administrator
It creates the user and applies the password in an encrypted format.

MongoDB (ServerService) not installing on windows10

I am trying to install mongodb on my windows10 computer, but keep getting error that I don't have the privileges, even though I am the admin user.
I tried running the msi installer getting the error. So I tried the commands shown in the docs https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#procedure using the terminal running as admin, but getting the same error as seen below.
I am trying to install it on my D:/ Drive. But I also tried installing it in the default C:/Program Files/MongoDB/Server/4.4/ but it didn't work as well.
cmd: msiexec.exe /l*v mdbinstall.log /qb /i mongodb-windows-x86_64-4.4.3-signed.msi INSTALLLOCATION="D:\Program_Files\MongoDB\Server\4.4\" ADDLOCAL="ServerService,Client,Router,MiscellaneousTools" SHOULD_INSTALL_COMPASS="0"
The log on as a service user right allows accounts to start or run services on a Windows machine. By default, and due to security reasons, services can only be configured to run under the Local System, Local Service or Network Service accounts which have a built-in right to log on as a service. Any other user account that requires to run a service must be assigned this right.
Run gpedit.msc.
Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies >User Rights Assignment.
In the details pane, double-click Log on as a service.
Click Add User or Group and add the account to the list of accounts that have the Log on as a service right. Once you have selected the user, click OK.
Click OK and close the policy editor.
References :
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/log-on-as-a-service
No matter what I tried, I just couldn't get the Server Service to install on my system through the msi, using either the gui or command line.
So finally I installed it without checking the "Install MongoD as a Service" option.
It successfully installed the mongodb including the mongod.exe in the bin (finally).
Then ->
Set the environment variables PATH to my bin folder
Create the /data/db and /log/mongo.log in the directory you want
Type the command mongod --directoryperdb --dbpath <your_dir_path>\data\db --logpath <your_dir_path>\log\mongo.log --install
Type the command net start MongoDB
And you will have the mongodb service running as I did.

Cannot login to keycloak admin console when running in domain cluster mode

Following the documentation guide, I have booted up a master and slave and I can see it connected via the logs:
Boot up master
$ domain.sh --host-config=host-master.xml
Boot up slave
$ domain.sh --host-config=host-slave.xml
I've also followed the steps to set up the admin user via the add-user.sh. Further research indicated that I should use the add-user-keycloak.sh script to add an initial admin user:
./add-user-keycloak.sh -u john
Press ctrl-d (Unix) or ctrl-z (Windows) to exit
Password:
Added 'john' to '../standalone/configuration/keycloak-add-user.json', restart server to load user
Reran the master and slave, but cannot login to admin console.
However, what's interesting is when I tried to boot up in standalone mode I was able to the admin console as john:
./standalone.sh
Is this a bug or am I missing something (most likely) that's not in the documentation?
Thanks in advance...
Figured it out, hope this helps somebody.
Before you start in domain cluster mode:
./domain --host-config=host-master.xml
./domain --host-config=host-slave.xml
you must first create the admin so you can log in to admin console using the --sc tag, otherwise add-user-keycloak.sh only adds the admin user for the standalone mode. To do that:
./add-user-keycloak.sh --sc ../domain/servers/server-one/configuration -u john -p password
if configuration folder does not exist, then create the directory.
The ./add-user-keycloak.sh script seems to be a little outdated. Currently (as of Keycloak 12.0.2 version) it creates keycloak-add-user.json file in ./domain/configuration/ directory - That is wrong!
The file should be in ./domain/servers/server-one/configuration.
Now you just have to move the file to that directory, restart the server and it should work properly.
I found this solution on this 2-year old email thread:
https://lists.jboss.org/pipermail/keycloak-user/2018-January/012642.html

Running PGAdmin after Silent installation, what is the login?

I started an installation of Postgres in unatended mode with the commandline:
postgresql-9.5.2-1-windows-x64-x64.exe --unattendedmodeui minimal --mode unattended --superpassword "password" --servicename "postgreSQL"
--servicepassword "password" --serverport 5432
After the installation is finished i want to login to the database with pgadmin. i tried with "password" but i get the error:
fatal password authentication failed for user postgres
so what are my login data for the installed database?
Thanks a lot
Marcel
If you don't know the password you have to change the pg_hba.conf file that contains all the authentication information.
You can read about how it works here:
http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html
I suggest you to create a backup of the original file first and to reboot the server after changes.
I was facing the same issue. It looked like there was a conflict with previous installations of Postgres.
I could login using the password specified by --superpassword after cleaning all Postgres-related folders in program files as well as in custom install locations.
A professional approach would be running your installer on a clean system or a VM.

Logon failure in running a windows service

I am running a service called prunner on windows server 2012. I used the command sc to change the username and the password of the service:
sc.exe config myService obj= "sqa265\hero" password= "hero1"
The output of the command is saying that it have succeed but when I go to task manager in order to start the service I get: logon failure!!!
I tried to run the sc command under the user hero and under the user administrator but I still get the same error. But the very strange thing is that if I do the same thing manually via the task manager and service control pane I success and the service go to the state:running!!! But I need to automate this thing, so please any help?
You need to give the account "sqa265\hero" the SeServiceLogonRight permission. As you have noticed setting the credentials up through the control panel works, but what you might not have noticed is that if you tried to use the command line after using the control panel.
You can test this by setting the service back to the Local System account in the control panel, and then running your command-line again.
To fix this from a script, you can use the NTRights utility outlined in this MS knowledgebase article:
http://support.microsoft.com/kb/315276
After you install NTRights, you can run it like this:
NTRights.exe +r SeServiceLogonRight -u "sqa265\hero"
Combined with the sc config commandline you already have, the service should run with those credentials.
Further reading:
http://www.techrepublic.com/article/set-user-rights-using-the-ntrights-utility/5032903