nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

How to make a file/folder invisible in NFS exported fs?

This is a discussion on How to make a file/folder invisible in NFS exported fs? within the Linux software forums, part of the Linux Getting Started category; Hi all, Anyone knows how to make files or folder invisible in NFS exports? In samba there's an option veto ...

Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-10-2006, 08:09 AM
Member
User
 
Join Date: Jun 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
warren
Default How to make a file/folder invisible in NFS exported fs?

Hi all,

Anyone knows how to make files or folder invisible in NFS exports?
In samba there's an option veto files...this will make certain files or directories invisible and unaccessible but I dont have idea in NFS. Looks like there are no equivalent options in NFS...?

Thanks for any help..
Warren
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-10-2006, 12:26 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
Posts: 586
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 8
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Use chmod and chgrp/chown command to setup permission on files. For example only root should allow to see folder foo:

Code:
chmod 0700 foo
chown root:root foo
nfs bases its access control to files on the server machine on the uid and gid provided in each NFS RPC request. The normal behavior a user would expect is that she can access her files on the server just as she would on a normal file system. This requires that the same uids and gids are used on the client and the server machine.

In short use NIS to give same UID,GID to both client/server to permission works nicely.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 04-10-2006, 03:22 PM
Member
User
 
Join Date: Jun 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
warren
Default

thanks for the reply.
So the point is we just set the permission of the file in which only the root have access. What I mean is that when the client mounts the exported fs, certain files/folders would be totally invisible to him.
ex:
/etc/exports
/mnt/nfs *(rw,root_squash,secure,sync,no_wdelay)

-bash-3.00# mkdir test
-bash-3.00# chmod 0700 test
-bash-3.00# chown root:root test
-bash-3.00# ls -l
total 1
drwx------ 2 root root 1024 Apr 10 17:35 test

When the nfs client mounts it, he can still see the folder "test" but have no access. My problem is how this folder will become hidden to him.
I tried hiding this folder but the client may still able to see if he set his browser to show hidden files.
Reply With Quote
  #4 (permalink)  
Old 04-10-2006, 04:16 PM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
sweta will become famous soon enough
Default

Under UNIX/Linux you need to add . (dot) to hide directory. To hide dir called docs rename it as .docs:
Code:
mv docs .docs
ls
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #5 (permalink)  
Old 04-10-2006, 04:36 PM
Member
User
 
Join Date: Jun 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
warren
Default

yes, hiding will partially work but if the clients set his browser to show all hidden files or "ls -a" then he's still able to see it all.
something like veto in samba but there's no equivalent option in nfs. acls might do a trick for this.
Reply With Quote
  #6 (permalink)  
Old 04-10-2006, 04:50 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
tom is on a distinguished road
Default

yup acls might do a trick for this but note that ACL is not supported by all Linux/UNIX NFS client, especially the nfs 2 clients. But you can force all client to use nfs v3 or higher
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Ubuntu Linux folder permissions myfoot Ubuntu / Debian 1 12-01-2007 08:03 PM
A script for Removing all the files inside a folder and its sub folder vivekv Shell scripting 1 10-25-2007 01:44 PM
Make file script, need help understanding shaziluk Shell scripting 0 09-16-2007 03:30 AM
rsync folder zafar466 Shell scripting 1 04-28-2007 03:28 AM
i need a script to delete one folder with files on my ftp silver_ch Shell scripting 1 03-27-2007 10:15 AM


All times are GMT +5.5. The time now is 05:37 AM.


Powered by vBulletin® Version 3.8.3 - Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36