# How to pass Amazon S3 credentials to mmctl remotely

**URL:** <https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304>\
**Category:** Troubleshooting\
**Created:** [October 12, 2025, 1:15pm UTC](https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304 "2025-10-12T13:15:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashim](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@ashim](https://forum.mattermost.com/u/ashim)\
**Post date:** [October 12, 2025, 1:15pm UTC](https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304/1 "2025-10-12T13:15:15Z")

</div>

Hello everyone,

I am trying to export mattermost data. I use Amazon S3 to save attachments. I am not sure how to pass Amazon S3 credentials to the mmctl command.

Here is what I tried :

$ ./mmctl auth login [https://my-website.com](https://my-website.com)

$ ./mmctl export create --attachments  
$ ./mmctl export job list  
ID: yq3t6kkmzpb15xqyjtn8ui6g3w  
Type: export\_process  
Status: error  
Created: 2025-10-12 18:30:36 +0530 IST  
Started: 2025-10-12 18:30:46 +0530 IST  
Data: map[channel\_schemes\_exported:0 channels\_exported:81 direct\_channels\_exported:655 direct\_posts\_exported:38294 error:Error during job execution. — exportFileAttachment: Failed to copy file during export., err=The specified key does not exist. include\_attachments:true include\_roles\_and\_schemes:true posts\_exported:38461 roles\_exported:22 team\_schemes\_exported:0 teams\_exported:3 users\_exported:174]

How exactly should I pass:

```auto
aws_access_key_id and aws_secret_access_key

```

to the mmctl command?

Please note these are saved in my config.json in the remote server. Can I not tell mmctl to lookup that file?

Thank you,

Ashim

---

<div class="post-metadata">

**Author:** ![ashim](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@ashim](https://forum.mattermost.com/u/ashim)\
**Post date:** [October 18, 2025, 12:02pm UTC](https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304/2 "2025-10-18T12:02:23Z")

</div>

Hello everyone,

Can someone please help me with this?

Thank you,

Ashim

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [October 21, 2025, 8:09pm UTC](https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304/3 "2025-10-21T20:09:45Z")

</div>

Thanks for the detailed logs, Ashim!

**`mmctl export ... --attachments` runs server-side and pulls from the server’s S3 settings** , so there’s no way (or need) to pass `aws_access_key_id`/`aws_secret_access_key` to `mmctl`; instead confirm your S3 config in the Mattermost server’s `FileSettings` (bucket/region/key/secret, and any path prefix) and IAM permissions, as “The specified key does not exist” often means a bucket/key prefix mismatch. See the docs for [Bulk export](https://docs.mattermost.com/administration-guide/manage/bulk-export-tool.html) and for [Configuration settings](https://docs.mattermost.com/administration-guide/configure/configuration-settings.html) (`config.json`).

---

<div class="post-metadata">

**Author:** ![ashim](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@ashim](https://forum.mattermost.com/u/ashim)\
**Post date:** [October 22, 2025, 2:17pm UTC](https://forum.mattermost.com/t/how-to-pass-amazon-s3-credentials-to-mmctl-remotely/25304/4 "2025-10-22T14:17:37Z")

</div>

Dear John,

Many thanks for your reply.

I tried going to: System Console \> Environment \> File Storage \> Test Connection

and it worked all OK.

We do not have a path prefix. That setting is empty.

Any ideas for me ?

Many thanks,

Ashim
