Skip to content

Instantly share code, notes, and snippets.

@killfill
Created August 13, 2017 15:22
Show Gist options
  • Save killfill/d5c47ca32b23aabd5112dd3147e9333e to your computer and use it in GitHub Desktop.
Save killfill/d5c47ca32b23aabd5112dd3147e9333e to your computer and use it in GitHub Desktop.
Smartos NFS share auth
#SmartOS/Server
NAME="test"
zfs create zones/$NAME
zfs set quota=10G zones/$NAME
zfs set sharenfs=rw zones/$NAME
chmod 777 /zones/$NAME
share -F nfs -o sec=sys /zones/$NAME
#Linux/Client
# mount storage1:/zones/test /root/hola/
# chown root hola/hola
chown: changing ownership of 'hola/hola': Operation not permitted
@killfill
Copy link
Author

[root@storage1 ~]# NAME="test2"
[root@storage1 ~]# zfs create zones/$NAME
[root@storage1 ~]# zfs set quota=10G zones/$NAME
[root@storage1 ~]# zfs set sharenfs=rw,root=10.10.0.11 zones/$NAME

[root@blade1 ~]# ifconfig |grep 'inet 10.10'
inet 10.10.0.11 netmask ffff0000 broadcast 10.10.255.255
[root@blade1 ~]# mount -Fnfs -o rw,intr storage1:/zones/test2 nfs-mount-dir
[root@blade1 ~]# cd nfs-mount-dir; ls -la
total 4
drwxrwxrwx 3 root root 3 Aug 14 00:06 .
drwxr-xr-x 4 root root 512 Aug 13 23:56 ..
drwxr-xr-x 2 nobody nobody 2 Aug 14 00:06 a

[root@blade1 ~/nfs-mount-dir]# chown root a
chown: a: Not owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment