Title
#fleet
Mo Zhu

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?
Kathy Satterlee

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?
Mo Zhu

Mo Zhu

06/15/2022, 6:27 PM
I did not. I just ran the command…
6:27 PM
And some fleetctl commands do not require sudo
6:27 PM
oh actually
6:27 PM
that’s not true. I do need to run sudo for everything
6:30 PM
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.
Kathy Satterlee

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.
zwass

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)
.
Kathy Satterlee

Kathy Satterlee

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

Mo Zhu

06/15/2022, 6:40 PM
Awesome… thanks!
6:41 PM
Alright, sorry, so now I’m getting a different permission error.
6:41 PM
open /Users/mozhu/.fleet/config: permission denied
6:41 PM
So to address this, I ran
chmod a+rw ~/.fleet/config
6:41 PM
Now that file is permission 666.
6:42 PM
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
6:42 PM
So it seems like it wants me to have a root-only readable config file. But I think that would require me to sudo?
Keith Swagler

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
Mo Zhu

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
zwass

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
.
Mo Zhu

Mo Zhu

06/15/2022, 7:18 PM
That worked! all good now!