https://github.com/osquery/osquery logo
#fleet
Title
# fleet
m

Mo Zhu

06/15/2022, 6:23 PM
Sorry, team, another question… In order to run some commands such as
fleetctl query
or
fleetctl config
, I have to call sudo. Is there some way for me to make that go away, or is that on purpose?
k

Kathy Satterlee

06/15/2022, 6:25 PM
NPM and permissions can be a little odd at times. Did you have to use
sudo
for the install as well?
m

Mo Zhu

06/15/2022, 6:27 PM
I did not. I just ran the command…
And some fleetctl commands do not require sudo
oh actually
that’s not true. I do need to run sudo for everything
It might be because I’m using fleetctl from an orbit build that was given to me. It might not have been intended for me to use it in a dev-like way.
k

Kathy Satterlee

06/15/2022, 6:30 PM
Gotcha. It definitely sounds like permissions. I generally use
nvm
to install Node and npm. There's some good documentation here. It's specifically focused on errors when installing global packages, but the same idea applies.
z

zwass

06/15/2022, 6:33 PM
Yes it definitely depends on how you install fleetctl. This might fix it:
chmod a+x $(which fleetctl)
.
k

Kathy Satterlee

06/15/2022, 6:33 PM
^
@zwass always knows what's what.
m

Mo Zhu

06/15/2022, 6:40 PM
Awesome… thanks!
Alright, sorry, so now I’m getting a different permission error.
open /Users/mozhu/.fleet/config: permission denied
So to address this, I ran
chmod a+rw ~/.fleet/config
Now that file is permission 666.
However, when I run a query, it gives me a new error:
File /Users/mozhu/.fleet/config already exists with mode 666 instead of the expected 600
So it seems like it wants me to have a root-only readable config file. But I think that would require me to sudo?
k

Keith Swagler

06/15/2022, 7:15 PM
just to catch up, you can run fleetctl as user mozhu now? If you are running fleetctl as mozhu you should be able to set the perms back to 600 on ~/.fleet/config
m

Mo Zhu

06/15/2022, 7:16 PM
@Keith Swagler No, because if I run fleetctl as mozhu, I get
Error: error verifying that config exists at /Users/mozhu/.fleet/config: open /Users/mozhu/.fleet/config: permission denied
z

zwass

06/15/2022, 7:16 PM
Ah yeah it seems like all the permissions got created for user
root
. You'll want to do
sudo chown -R mozhu /Users/mozhu/.fleet/config
.
m

Mo Zhu

06/15/2022, 7:18 PM
That worked! all good now!
👍 1
5 Views