Getting Data In

Windows Splunk - difficulty changing default password from CLI

s6a9d6u9s
New Member

I'm working on some scripts to install Splunk and configure several things right off the bat, under several different OS's. For some reason the Windows splunk client is behaving differently than the Linux one.

After a fresh Splunk install, when I try to change the default password, I'm getting the following error:

> "C:\Program Files\Splunk\bin\splunk.exe" edit user 'admin' -password '(random pass)' -role Admin -auth 'admin:changeme'
Login failed
Login failed

If I run that same command again but leave off the -auth section, so it prompts me for a username/password, it is rejecting admin:changeme on the CLI.

> "C:\Program Files\Splunk\bin\splunk.exe" edit user 'admin' -password '(random pass)' -role Admin
Your session is invalid.  Please login.
Splunk username: admin
Password:
In handler 'users': Could not get info for non-existent user: 'admin'

I can however log into the web interface as admin:changeme, oddly enough.

Come to think of it, on the Linux side I am starting splunk up with "--accept-license --answer-yes" before changing the password, however I haven't been trying to do that in Windows since it's running as a service OK. Is that the catch?

Thanks!

Tags (4)
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

bwooden is correct that you would be better off loading user-seed.conf into the install prior to first run for scripted installs. But your problem is that you're using the single quotes (') around your arguments. Windows does not use those to quote arguments. Unless you have spaces within the user name or password, you should just leave the quotes off. If you do have spaces, then you should use double-quotes ("), not single quotes ('), at the Windows CLI.

bwooden
Splunk Employee
Splunk Employee

For a scripted install you may find it easier to use the user-seed.conf to change admin's password on initial startup.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...