I got succeeded! Mostly I followed the tutorial which I linked in the question. However the OS used in the question is CentOS different with FreeBSD.
Server side configurations
First just initiate a FreeBSD box with SSH and NFS. I used fresh new installation in VM.
I made a directory to share
chmod 777 /ttt
And exported it via NFS by adding this line to
And add this line to
All done. No more server-side setting job required.
-n enables non-root mount. It feels some security issue but however this is most simple way. I'll post a new question about security of this flag.
Client side configurations
And establish 2 SSH tunnels.
ssh -2 -N -L 5000:localhost:2049 firstname.lastname@example.org
ssh -2 -N -L 5001:localhost:1019 email@example.com
test.local is the address of the FreeBSD box. And the
localhost in the command means the FreeBSD box itself. (This will be evaluated in server-side) You have to open multiple terminal window because I didn't set
-f to keep SSH foreground. Just for checkup.
The port number
2049 is default port for NFS server, and
1019 is default port of
mountd. You have to always specify this port numbers because NFS has no official default port number. (That's just de-facto standard :) I don't know about mountd. 2 days taken getting know the fact that I have to specify these damn port numbers.
And in other terminal, mount via SSH tunnels.
mount_nfs -v -o port=5000,mountport=5001,tcp localhost:/ttt /tttm
-v for log messages. I have
/tttm folder on my Mac. These messages,
mount localhost:/ttt on /tttm
mount flags: 0x0
127.0.0.1 tcp,port=5000,mountport=5001, fh 28 ea58774dc6ccd11b0c000000016a00003300c1da0000000000000000
NFS options: 0x3004200 fg,retrycnt=1,vers=3,sec=sys (1)
printed, and shared volume appeared at the location
My method may have many security issues. Such as
chmod 777 or
-n switches look insecure. If you know better configuration, please let me know. Thank you.