大网数据广告活动
服务器运维问答

How to configure NFS to resolve symbolic links on the server side?

· 52CE 我爱测

My beard is solid grey now, and I long recall using NFS for all these decades and here I cite the original RFC that gives us the basis for the NFS we have today RFC1094 . Of course, three decades and some have passed since then, …

问题原文

原帖链接 · Richard T · CC BY-SA 4.0

My beard is solid grey now, and I long recall using NFS for all these decades and here I cite the original RFC that gives us the basis for the NFS we have today RFC1094. Of course, three decades and some have passed since then, so here's the question:

In the interim has it become possible now, via a configuration option, to have links interpreted from the server side? This would surely clear up a number of my problems of client-side interpretation of links!

Or, am I all wet, and what I'm citing is obsolete and it's really, by default, resolving on the server side and I'm just chasing rabbits down rabbit-holes in my troubleshooting?

IF IT'S STILL OLD-SCHOOL AND INTERPRETED CLIENT SIDE, and if there is NOT an option that enables server-side interpretation, does using relative links instead of absolute ones possibly help?

Thanks.

社区高分解答

原帖链接 · kofemann · CC BY-SA 4.0

The symlinks are always resolved by the client. There are several reasons for that. First of all, the NFS protocol has a concept of a file handle. Each handle points to a file system object that can be a directory, a file or a symlink (and some others). Moreover, NFSv4.1 spec is clearly says:

Whether created by an NFS client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.

Second, by processing the symlink on the server side additional permission rules have to be taken into account, as symlink might point to outside on the exported filesystem.

Indeed, SAMBA servers have no option to follow symlinks. This is due to (a) original MS file systems didn't have a concept of a symlinks and (b) symbolic link as file system object type are added in SMB2. The behavior, BTW, matches NFS interpretation:

Symbolic links MUST NOT be evaluated by the server.

There are couple of user-space NFS server that allow custom file system implementations, if needed:

If there is a good reason to resolve symlinks on the server side, this can be added.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-08-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。