使用s3cmd操作对象

前言

ceph 天然支持对象存储,经常使用XShell访问server,习惯了在console里做一些操作,那么,如何

获取S3 key

ceph提供radosg-admin命令,方便查询S3账号的属性信息,诸如ACL,quota,AKEY,SKEY等等一些信息,如下所示:

shell

root@auto-70-1:~# radosgw-admin --uid=user01 user info
{
    "user_id": "user01",
    "display_name": "user01",
    "email": "user01@126.com",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [
        {
            "id": "user01:user01",
            "permissions": "full-control"
        }
    ],
    "keys": [
        {
            "user": "user01",
            "access_key": "4B2DT6E0B9C5R6MJ8OEA",
            "secret_key": "XI5ZxYejXiZXUJWtzLDEs4OXiGOYVDuoXVhBYtIa"
        }
    ],
    "swift_keys": [
        {
            "user": "user01",
            "secret_key": "1"
        },
        {
            "user": "user01:user01",
            "secret_key": "1"
        }
    ],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

root@auto-70-1:~# 

配置s3cmd config

通过上面获取到的AKEY和SKEY,就可以进行s3cmd的配置操作了。

shell

root@auto-70-1:~# s3cmd --configure

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
Access Key: 4B2DT6E0B9C5R6MJ8OEA
Secret Key: XI5ZxYejXiZXUJWtzLDEs4OXiGOYVDuoXVhBYtIa

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: 
Path to GPG program [/usr/bin/gpg]: 

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can't be used if you're behind a proxy
Use HTTPS protocol [No]: 

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't conect to S3 directly
HTTP Proxy server name: 

New settings:
  Access Key: 4B2DT6E0B9C5R6MJ8OEA
  Secret Key: XI5ZxYejXiZXUJWtzLDEs4OXiGOYVDuoXVhBYtIa
  Encryption password: 
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: False
  HTTP Proxy server name: 
  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] n

Save settings? [y/N] y
Configuration saved to '/root/.s3cfg'
root@auto-70-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值