# InfluxDb 2.5: error 401 access denied when executing "influx server-config"

**URL:** <https://community.influxdata.com/t/influxdb-2-5-error-401-access-denied-when-executing-influx-server-config/27538>\
**Category:** InfluxDB 2\
**Tags:** security\
**Created:** [November 28, 2022, 3:06pm UTC](https://community.influxdata.com/t/influxdb-2-5-error-401-access-denied-when-executing-influx-server-config/27538 "2022-11-28T15:06:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgeithner](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/wgeithner/32/3234_2.png) [@wgeithner](https://community.influxdata.com/u/wgeithner)\
**Post date:** [November 28, 2022, 3:06pm UTC](https://community.influxdata.com/t/influxdb-2-5-error-401-access-denied-when-executing-influx-server-config/27538/1 "2022-11-28T15:06:54Z")

</div>

I recently upgraded a 1.8.10 installation to InfluxDB V2.5.1 on a Debian 9 machine. bolt-path, sqlite-path and engine-path have been re-directed to a custom path by modifying respective configuration files.

Initially, the configuration pointed to the default directories:

- bolt, sqlite and engine pointed to /root/.influxdbv2

When starting InfluxDB in this initial configuration via _sudo systemctl start influxd_, I was able to display the _influx server-config_ without any problems.

However, after re-directing the path to the custom one, it is not possible to display the server-config; I get a “401 unauthorized” error. I CAN log in via the web-UI and admin user.

Things I tried (all lead to error 401):

- influx server-config
- sudo influx server-config
- created new operator token in web-UI (All purpose token). With this token
- influx server-config -t 
- sudo influx server-config -t 
- Changed ownership of custom directory from root to influxdb and back

Note: not only “influx server-config” does not work, but as it seems any critical “influx”-command throws 401.

Now I am lost. Any help appreciated.

---

<div class="post-metadata">

**Author:** ![wgeithner](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/wgeithner/32/3234_2.png) [@wgeithner](https://community.influxdata.com/u/wgeithner)\
**Post date:** [November 28, 2022, 4:47pm UTC](https://community.influxdata.com/t/influxdb-2-5-error-401-access-denied-when-executing-influx-server-config/27538/2 "2022-11-28T16:47:51Z")

</div>

OK, I found the error: as it seems, I made a copy/paste error when copying the admin token. After copying this correctly, the “influx server-config -t ” worked.
