# Access S3 Bucket with s3cmd

### Prerequisite

* ต้องมี bucket สร้างเอาไว้แล้ว [(ขั้นตอนในการสร้าง bucket)](https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket)
* มีการสร้าง subuser และ ให้สิทการเข้าถึง bucket เอาไว้แล้ว ([ขั้นตอนการสร้าง subuser และ access key](https://docs-epc.gitbook.io/ncs-documents/~/changes/U2SVceQUXXCaek3t7CoE/object-storage/create-object-storage-sub-user))

### Preparing

ทำการติดตั้ง s3cmd command line

* macOS

```bash
brew install s3cmd
```

* ubuntu

```bash
apt install s3cmd
```

### Getting started

#### การ Configuration

ใช้ command s3cmd --configure เพื่อใช้ในการ config โดยใส่ข้อมูลดังนี้

* Access Key → ที่ได้จากการสร้าง user ([ขั้นตอนการสร้าง subuser และ access key](https://docs-epc.gitbook.io/ncs-documents/~/changes/U2SVceQUXXCaek3t7CoE/object-storage/create-object-storage-sub-user))
* Secret Key → ที่ได้จากการสร้าง user ([ขั้นตอนการสร้าง subuser และ access key](https://docs-epc.gitbook.io/ncs-documents/~/changes/U2SVceQUXXCaek3t7CoE/object-storage/create-object-storage-sub-user))
* Default Region -> ให้ใช้เป็น NCP-TH
* S3 Endpoint → โดยขึ้นอยู่กับ AZ ของ Bucket ที่สร้าง หากเป็น bkk ให้ใช้ [s3-bkk.nipa.cloud](http://s3-bkk.nipa.cloud/) หากเป็น non ให้ใช้ [s3-non.nipa.cloud](http://s3-non.nipa.cloud/) [(ขั้นตอนในการสร้าง bucket)](https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket)
* bucket name → ซึ่งได้จากการสร้าง Bucket [(ขั้นตอนในการสร้าง bucket)](https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket)

<figure><img src="https://1352697161-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq2BYmWTMiaonrEL8QBP2%2Fuploads%2FKycFkRUuezahpxPbULvi%2FScreenshot%202566-11-16%20at%2015.52.11.png?alt=media&#x26;token=cf69175c-652d-4d5b-8bc3-a90b8fbf8e94" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/access-s3-bucket-with-s3cmd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
