How to enable root access on NFS share in Solaris 10

Posted: March 19, 2007 in howto, OS, Solaris 10, Technology

If you don’t care about security and prefer to use only root account across all your machines, including on NFS shared file system, here is how you allow NFS clients root access on a NFS shared file system:

share -F nfs -o rw,root=host1:host2:host3 /nfs_share_dir

Note the root=access_list option defines which host has root access to this specific NFS share.

Source: share_nfs

Special thanks to Greg N. for pointed out share_nfs man page.

Comments
  1. Mr. Lee says:

    Yeah this works on Solaris 10 but it doesn’t work using Solaris 9, do you know how to do it on Solaris 9?

    thanks!

  2. Dave says:

    Hi Mr. Lee, Although I don’t have a Solaris 9 box to verify if root access list works the same way or not, the share_nfs link that I provided in the blog post actually is on Solaris 9. So, I would expect the technique should work for Solaris 9.

  3. Christian says:

    For some reasons unkown to me the method above doesn’t work with Solaris 9. I tried it on several of our boxes.
    Know I’m using root=,anon=0. But I’m not sure if this is a good idea. But this is just a temporary share anyway.

  4. Dave says:

    You should use root=host1:host2:host3 syntax. I have not tried to use other ways to enable root access. If you find a better way, let me know.

  5. AIX says:

    It worked fine for me on Solaris 8 Server.

  6. Dave says:

    Hi AIX,

    Good to know this trick also works for Solaris 8.

  7. Orf Gelbrich says:

    THe problem with that is though that now any one on the net work can mount that share and the acess list seems to be ignored:
    182:scalpel:/# share -F nfs -o root=host1 /tmp
    183:scalpel:/# showmount -e scalpel
    export list for scalpel:
    /jump (everyone)
    /tmp (everyone)

    Why is the access list ignored?

  8. Dave says:

    Hi Orf,
    According to this page “root=list Allows root access to root user on clients specified by list.” I would read it as not excluding other users from mount the share resource. They just can’t mount as root from hosts that isn’t specified by this root= option. You might want to add rw=list option to further restrict access. Let me know how this work for you. Thanks.

  9. Avdhesh chaudhary says:

    hi
    we have solaris server, we makes group and user herichey
    now i want to access my solaris server from any window based host.so that i take bakup of main folder which is used by these group.can you help me

  10. Dave says:

    Hi Avdhesh,

    I am sure there are other fancier ways to do what you want. Here are a few simple ideas:

    install Samba if you want. If you want to preserve the file structure and permission configuration on the files, you might want to run a cron job to tar up the directory and compressed it so you can just copy the back-up file using Samba/scp/ftp/nfs.

  11. [...] above will share the directory read-only. If you would like to map the directory as root and be able to write to it, the command would look more like [...]

  12. Hallo ich bin der Neue,
    habe das Forum ueber Google gefunden, und sieht ganz gut aus.
    Hab jetzt ne Menge zu lesen, und werde danach hoffentlich auch was zu diesem und jenem sagen koennen .
    Gruss an Alle

  13. Kudos for the great piece of writing. I am glad I have taken the time to read this.

  14. Thank you for one more important article. In which else could anyone get that type of data in such a full way of writing? I’ve a presentation incoming week, and I’m on the lookout for these info.

  15. Wow that was strange. I just wrote an incredibly long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say superb blog!

  16. Frank says:

    Hi Dave

    A directory owned by an application user “websph” in NFS server to be shared to a NFS client having same user/group, to be able to write to the NFS filesystem without change in ownership at the client.

  17. Yeah this works on Solaris 10 but it doesn’t work using Solaris 9, do you know how to do it on Solaris 9?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s