As someone who grew up on Windows but is now learning Splunk, it's very important for me to learn Linux/Unix. It must be a gift from heaven that we can now run Ubuntu on top of Windows via their new app on Windows Store called Ubuntu which allows you to use Ubuntu terminal while on Windows via cmd (not VM).
I have learned that it's very important not to install Splunk as root or using sudo. Why am I getting permission denied?
Here's what I did;
See:
My intention is to practice myself navigating on Linux as this is required in my job. Thanks for your help!
The best thing to do is
- Run as root . (sudo to root)
- untar as root
- after it is completely unpacked, the do chown -R splunk:splunk /opt/splunk
Looks like your problem is not the tar itself. Seems like your user does not have enough rights to create a folder at /opt/apps/splunk. Try
sudo tar -xzvf ...
And when you finished, change the owner of the splunk installation path back to the desired owner (e.g. a user called splunk). This is also shown in the splunk installation manual:
Thank you. I would also accept this as answer but another one has came in first.
The best thing to do is
- Run as root . (sudo to root)
- untar as root
- after it is completely unpacked, the do chown -R splunk:splunk /opt/splunk
Hey. thanks for the response. what is splunk:splunk? should I be changing that to my username?
No, you should create a user and a group called "splunk". With the chown command you can change the owner of a folder to another user and group. in this case to the the user splunk and the group splunk = splunk:splunk.
Simple: you install as root, but since best practise is not to run splunk as root, you change back to an other user after installation.
As mentioned, there is a step by step guide in the docs: https://docs.splunk.com/Documentation/Splunk/7.2.6/Installation/RunSplunkasadifferentornon-rootuser#...
thank you. accepted answer