ceph fs authorize cephfs client.foo / r /bar rw
+ results in:
+
+ client.foo
+ key: *key*
+ caps: [mds] allow r, allow rw path=/bar
+ caps: [mon] allow r
+ caps: [osd] allow rw tag cephfs data=cephfs_a
+
To completely restrict the client to the ``bar`` directory, omit the
root directory ::
with a "ceph." prefix, as well as restricting other means of setting
these fields (such as openc operations with layouts).
-For example, in the following snippet client.0 can modify layouts and quotas,
-but client.1 cannot.
+For example, in the following snippet client.0 can modify layouts and quotas
+on the filesystem cephfs_a, but client.1 cannot.
::
key: AQAz7EVWygILFRAAdIcuJ12opU/JKyfFmxhuaw==
caps: [mds] allow rwp
caps: [mon] allow r
- caps: [osd] allow rw pool=data
+ caps: [osd] allow rw tag cephfs data=cephfs_a
client.1
key: AQAz7EVWygILFRAAdIcuJ12opU/JKyfFmxhuaw==
caps: [mds] allow rw
caps: [mon] allow r
- caps: [osd] allow rw pool=data
+ caps: [osd] allow rw tag cephfs data=cephfs_a
.. _User Management - Add a User to a Keyring: ../../rados/operations/user-management/#add-a-user-to-a-keyring
goto done;
}
- auto data_pools = fs->mds_map.get_data_pools();
- for (auto p : data_pools) {
- const string &pool_name = mon->osdmon()->osdmap.get_pool_name(p);
- osd_cap_string += osd_cap_string.empty() ? "" : ", ";
- osd_cap_string += "allow " + osd_cap_wanted + " pool=" + pool_name;
- }
+ osd_cap_string += osd_cap_string.empty()? "" : ", ";
+ osd_cap_string += "allow " + osd_cap_wanted
+ + " tag " + pg_pool_t::APPLICATION_NAME_CEPHFS
+ + " data=" + filesystem;
std::map<string, bufferlist> wanted_caps = {
{ "mon", _encode_cap("allow r") },