zlacker

[parent] [thread] 14 comments
1. chasil+(OP)[view] [source] 2022-06-21 03:07:11
Under NFSv2 and NFSv3, the numeric user and group id is used to determine permission, and these must be aligned between the client and server. I have an oracle uid 60 on an older system that maps as elcaro on an NFS client (because I have a different oracle user there as uid 54321).

Under NFSv4, direct uid/gid is no longer used, but the RPC.idmapd process determines privilege. I'm not really sure how it works beyond continuing to work when uid/gid synchronization is in place for NFSv3 and the connection is upgraded.

There is also an NFS ACL standard, but I don't know anything about it.

replies(3): >>jjoona+Ja >>zaarn+HA >>geertj+Ye1
2. jjoona+Ja[view] [source] 2022-06-21 04:56:48
>>chasil+(OP)
> these must be aligned between the client and server

looooool

(Seriously, though, could someone tell me why this was supposed to make sense?)

replies(3): >>toast0+2c >>neilv+Jx >>acdha+ww2
◧◩
3. toast0+2c[view] [source] [discussion] 2022-06-21 05:10:10
>>jjoona+Ja
If you've got centralized account management, it can work. Sending a fixed length 16-bit numeric id rather than a variable width username is a lot easier.

I've worked somewhere with a lot of NFS, and they had centralized account management, so everything was fine other than actual security, at least until we hit the limit of 16-bit uids. That place had a different centralized account management for production, so uids weren't consistent between corp and prod, but NFS in prod was very limited. (And you wouldn't nfs between corp and prod either)

I worked somewhere else without real centralized management of accounts on prod, and it was a PITA to bring that back under control, when it started becoming important. Even without intentional use of uids, it's convenient that they all line up on all servers; and it's a pain to change a uid that already exists on the system.

◧◩
4. neilv+Jx[view] [source] [discussion] 2022-06-21 08:04:58
>>jjoona+Ja
At the time, Sun NFS clients would receive equivalents of `/etc/passwd` over the network, using the YP service (later renamed NIS).

Like much of Unix, it was worse-is-better, and pretty productive for a site. (Well, until there was a problem reaching the NFS server, or until there was a problem with an application license manager that everyone needed.)

5. zaarn+HA[view] [source] 2022-06-21 08:30:58
>>chasil+(OP)
the NFSv4 ACL Standard is tangentially related to NFS, the TL;DR is that it replicates the kind of ACLs you can create under Windows (ie, seperate "Write to File" and "Append to File" into different permission bits, make inheritance configurable, etc.).

The TrueNAS people (ixsystems) have a patch to bring it to Linux and ZFS; though from what I've heard upstream LKML lists aren't too enthused since they'd rather see this being used by an in-kernel filesystem.

replies(2): >>trasz+YB >>jabl+nK
◧◩
6. trasz+YB[view] [source] [discussion] 2022-06-21 08:43:34
>>zaarn+HA
The ZFS support is there since the beginning (and used in Solaris and FreeBSD); Linux glue code is missing though.
replies(1): >>zaarn+MN
◧◩
7. jabl+nK[view] [source] [discussion] 2022-06-21 10:16:29
>>zaarn+HA
For Linux there's the richacl's (https://en.wikipedia.org/wiki/Richacls ) which was an attempt to add NFSv4/Windows style ACL's to the Linux VFS. It never went upstream though, AFAICT largely because the VFS maintainer thought such ACL's are stupid.
replies(1): >>zaarn+BN
◧◩◪
8. zaarn+BN[view] [source] [discussion] 2022-06-21 10:55:20
>>jabl+nK
The VFS maintainers are still not very warm about the idea, the current stipulation, IIRC, is that an in-tree FS should support it before it gets support from the VFS layer.
◧◩◪
9. zaarn+MN[view] [source] [discussion] 2022-06-21 10:56:28
>>trasz+YB
As mentioned, there is working glue code in form of the TrueNAS patches, which you can apply yourself if you need to. The Solaris support for NFS v4 ACLs is in my experience... subpar. It doesn't really integrate with any of the tooling (not that Solaris tooling is great to begin with).
replies(1): >>trasz+ua1
◧◩◪◨
10. trasz+ua1[view] [source] [discussion] 2022-06-21 13:45:34
>>zaarn+MN
Hopefully the Linux glue code doesn’t use the richacls abomination?
replies(1): >>zaarn+9n1
11. geertj+Ye1[view] [source] 2022-06-21 14:11:27
>>chasil+(OP)
> Under NFSv2 and NFSv3, the numeric user and group id is used to determine permission, and these must be aligned between the client and server.

Technically the server doesn't need to have a UID/GID database that's aligned with the client, what's required is that all clients of the same server are aligned. The server will take the numerical UID/GIDs from the RPC sent by the client and perform Posix style permission checks using the owner UID, owner GID, and mode bits stored in the inode of the file or directory. The server doesn't need to known what user the UID corresponds to.

replies(1): >>smarks+9H1
◧◩◪◨⬒
12. zaarn+9n1[view] [source] [discussion] 2022-06-21 14:56:32
>>trasz+ua1
It doesn't to my knowledge. It works out of the box and integrates with Samba.
◧◩
13. smarks+9H1[view] [source] [discussion] 2022-06-21 16:34:31
>>geertj+Ye1
Right. At least at Sun through the 1990s, when everybody had their own workstations, many network nodes had local filesystems, so they were both NFS clients and NFS servers. For this to work well it pretty much required that UIDs/GIDs were globally consistent.

This was maintained using YP/NIS. But Sun was too big for a single YP/NIS domain, so there was a hack where each YP/NIS master was populated via some kind of uber-master database. At least at one point, this consisted of plain text files on a filesystem that was NFS-mounted by every YP/NIS master....

This was all terribly insecure. Since everybody had root on their own workstations, you could `su root` and then `su somebody` to get processes running with their UID, and then you could read and write all their files over NFS. But remember, this was back in the day when we sent passwords around in the clear, we used insecure tools like telnet and ftp and BSD tools like rsh/rcp/rlogin. So NFS was "no more insecure" than anything else running on the network. But that was ok, because everything was behind a firewall. (Some sarcasm in those last bits, in case it wasn't obvious.)

replies(1): >>KateLa+2J2
◧◩
14. acdha+ww2[view] [source] [discussion] 2022-06-21 21:04:57
>>jjoona+Ja
> (Seriously, though, could someone tell me why this was supposed to make sense?)

Think about the environment it was originally used in — large organizations, computers which cost as much as a car, LANs which aren't easily accessible (e.g. the Unix people have access but laptops are expensive oddity and the sales people are probably sitting in front of a DOS box or shelled into that Unix server), etc. It's more defensible when your unix administrator is going to configure each of the servers to use the same NIS user directory.

All of that broke down when IP networking became the default, every desk in the building had a network port, and things like WiFi and laptops completely blew away the idea that the clients were managed by a single administrative group.

◧◩◪
15. KateLa+2J2[view] [source] [discussion] 2022-06-21 22:34:08
>>smarks+9H1
Sun did have a firewall by the early 90's. It had application-level proxies, and you'd have to configure applications to bounce through it if you wanted to get to the Internet. In many ways, this was more secure than today's default for firewalls where you can make any outbound connection you want but only the inbound connections are filtered.

Note that I'm not arguing that Sun was a leader in security, but they did make some efforts that other companies didn't.

[go to top]