> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/storage/object-storage-s3/access-s3-bucket-with-s3cmd.md).

# Access S3 Bucket with s3cmd

### Prerequisite

* ต้องมี bucket สร้างเอาไว้แล้ว [(ขั้นตอนในการสร้าง bucket)](/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket.md)
* มีการสร้าง 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)](/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket.md)
* bucket name → ซึ่งได้จากการสร้าง Bucket [(ขั้นตอนในการสร้าง bucket)](/ncs-documents/storage/object-storage-s3/create-an-object-storage-bucket.md)

<figure><img src="/files/BOf2FTbDcrALU83kOtll" alt=""><figcaption></figcaption></figure>
