问题原文
原帖链接 · Siu Ching Pong -Asuka Kenji- · CC BY-SA 4.0
From the exports(5) man page, in the "User ID Mapping" section, it says:
User ID Mapping
...
Very often, it is not desirable that the root user on a client machine is also treated as root when accessing files on the NFS server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or
nobodyuid. This mode of operation (called `root squashing') is the default, and can be turned off withno_root_squash....
Here's the complete list of mapping options:
root_squashMap requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids or gids that might be equally sensitive, such as userbinor groupstaff. no_root_squashTurn off root squashing. This option is mainly useful for diskless clients. all_squashMap all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories, news spool directories, etc. The opposite option isno_all_squash, which is the default setting....
I summarized the UID mapping options in the following table (assumed 1000 to be the UID of a non-privileged user, and 65534 to be the anonymous UID):
| Option | Client UID | Server UID |
|---|---|---|
| root_squash | 0 | 65534 |
| root_squash | 1000 | 1000 |
| no_root_squash | 0 | 0 |
| no_root_squash | 1000 | 1000 |
| all_squash | 0 | 65534 |
| all_squash | 1000 | 65534 |
| no_all_squash | 0 | 0 (unsure) |
| no_all_squash | 1000 | 65534 (unsure) |
Question
- Is my summary for the
no_all_squashoption correct? If yes, when will it be useful? - Which option is the default? The paragraph above says
root_squash, whileno_all_squashclaims itself default in the options explanation.
Thank you in advance!
社区高分解答
原帖链接 · Siu Ching Pong -Asuka Kenji- · CC BY-SA 4.0
After setting up a pair of NFS server and client in a virtual environment, I found the following result:
| Option | Client UID | Server UID |
|---|---|---|
| root_squash | 0 | 65534 |
| root_squash | 1000 | 1000 |
| no_root_squash | 0 | 0 |
| no_root_squash | 1000 | 1000 |
| all_squash | 0 | 65534 |
| all_squash | 1000 | 65534 |
| no_all_squash | 0 | 65534 |
| no_all_squash | 1000 | 1000 |
In other words, the no_all_squash option appears to behave the same as the root_squash option. This answers Question 1 and explains Question 2 at the same time.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
