> 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

การเข้าใช้งาน S3 ผ่าน command prompt ด้วย 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="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&amp;token=cf69175c-652d-4d5b-8bc3-a90b8fbf8e94" alt=""><figcaption></figcaption></figure>
