The sshAgentSocket path isn’t in the the ~/.nx/ UserNXDirectoryPath, it’s in the ServerRoot; for me, /usr/NX. That can’t really be shortened too much.
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk. If you wish to share the same ServerRoot for multiple
# nxhtd daemons, you will need to change at least LockFile and PidFile.
An example sshAgentSocket path is:
It’s not an SSH limitation; it’s a Linux kernel limitation; UNIX_PATH_MAX is a defined constant compiled into the Linux kernel.
I would like for NX to produce shorter session directory names so that the authentication forwarding functionality would work.