# 配置S3Cmd

$ s3cmd --configure -c ~/.s3cfg

出現提示訊息,並依照提示問題填入正確的值。

Enter new values or accept defaults in brackets with Enter.

Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.

問題 Value: 參考範例 (請依照實際資料填寫)
Access Key 8ff040ff9b58492990e16a61a4------
Secret Key a27e54bd2b9c46bf8926568b7f------
Default Region [US]
S3 Endpoint [s3.amazonaws.com] 172.18.19.21:13808
DNS-style bucket+hostname
Encryption password
Path to GPG program [/usr/bin/gpg]
Use HTTPS protocol [Yes] Yes
HTTP Proxy server name
Test access with supplied credentials? [Y/n] n
Save settings? [y/N] Y

*Value為空者,可直接按下enter使用預設值

填答完畢後,將會在home目錄下產生一s3cfg(~/.s3cfg),此時,我們需要進一步編輯此檔以完成設定。

$ vi s3login.cfg

找到以下參數並進行修改,將等號”=”後面的內容修改為正確的值後儲存便完成s3cmd的配置作業了。

參數 Value: 參考範例 (請依照實際資料填寫)
cloudfront_host 172.18.19.21:13808
host_bucket 172.18.19.21:13808/%(bucket)
signature_v2 True
Website_endpoint https://172.18.19.21:13808/%(bucket)
Last Updated: 9/22/2022, 7:29:43 PM