If a user can't access /a/b, then they can't access any file under /a/b/c. The permissions on /a/b/c are irrelevant since directory traversal stops at /a/b.
If all you want is to prevent the directory /a/b from being listed, but you're fine with users accessing files in /a/b if they guess a file name, then you can make /a/b executable but not readable. On a directory, the read permission only controls listing the directory contents, while the execute permission controls access to the entries of that directory.
# chmod u=rwx,go=x /a/b # chmod u=rwx,go=rx /a/b/c # echo 'hello' >/a/b/existingfile # su bob -c 'ls -l /a/b' ls: /a/b: Permission denied # su bob -c 'cat /a/b/nosuchfile' cat: /a/b/nosuchfile: No such file or directory # su bob -c 'cat /a/b/existingfile' hello # su bob -c 'ls -l /a/b/c' … contents of /a/b/c …
If you don't want other users to be able to access files in /a/b except for /a/b/c, you can expose /a/b/c via another view, through a bind mount.
# chmod u=rwx,go=x /a/b # chmod u=rwx,go=rx /a/b/c # mkdir /c # mount --bind /a/b/c /c # su bob -c 'ls /a/b/c' ls: /a/b/c: Permission denied # su bob -c 'ls -l /c' … contents of /a/b/c …
chmod +x /a/b