Unsolved

This post is more than 5 years old

47 Posts

3112

May 27th, 2009 21:00

Giving a host access to a NFS share

From time to time I have to grant a new host access to a NFS share.

What's the best and most fool proof way of doing this from the CLI? I'm always afraid I'll mistype the command and one of my existing hosts will lose access to the share.

Thanks!

42 Posts

May 27th, 2009 23:00

Hi Dee,

we always follow this procedure:
- issue a server_export server_2 -P nfs -list to get current exports for the filesystem
- copy the ro=, rw=, root=, access= components to another terminal / notepad...
- add the new host to the ro=/rw= lines as needed
- type the server_export command and copy+paste the ro/rw.. components into it

rgds,bernd

47 Posts

May 28th, 2009 10:00

Yeah that's what we're doing too. I was hoping there was an easier, less error prone way to do this.

Anyone have an idea?

Moderator

 • 

285 Posts

May 28th, 2009 11:00

You can use netgroups, and modify the netgroup file offline, which might help maintain the integrity of the access list. You can then make changes to the netgroup file without changing your export at all; just upload a new copy of the netgroup file.

47 Posts

May 28th, 2009 13:00

Hmmm....not a bad idea but I don't know that I really wanna use a netgroup. Any other ideas?

48 Posts

May 28th, 2009 14:00

You don't have to use NIS with a netgroup file;) And you can use subversion or another tool to kepp track of changes. Easy to script too.

32 Posts

September 8th, 2009 11:00

ps. - I do not have a NIS environment, just many standalone hosts. -John

32 Posts

September 8th, 2009 11:00

Can someone give an example of using a netgroup file ?

i.e. host entry format, location, applying

Does the file live under nasadmin somewhere ?

6 Operator

 • 

8.6K Posts

September 9th, 2009 02:00

see http://forums.emc.com/forums/thread.jspa?messageID=710630򭟦

If you dont have NIS the netgroup file has to be copied to the data mover using server_file as described in the Naming services manual.

Here's what it says about the format:

Create or edit a netgroup file

Each line of the netgroup file defines a group and has the format:
groupname member1 member2 ...

Each member is either the name of another group or indicates specific hosts, users,
and domains, referred to as a triple, as follows:
(hostname,username,domainname)

Any of the triple¿s three fields can be blank, meaning all the values in that field are
included. A dash (-) in any of the fields means there are no valid values. For
example, the following line defines a group called ouruniverse that consists of all
hosts and users in the NIS domain ourdomain.
ouruniverse (,,ourdomain)

The following lines define a group called ourhosts that includes all of the hosts but
none of the users in the domain, and a group called ourusers that includes all users
but no hosts.
ourhosts (,-,ourdomain)
ourusers (-,,ourdomain)

A netgroup file can include as many lines as required; however, each line must be
less than 1 KB in length. If necessary, a line can be continued on another line by
using the backslash (\) as a continuation character. A triple, however, cannot be
split across two lines.

Note: If you use a backslash (\) as a continuation character, it must be the last character on the line. It cannot be followed by spaces.
No Events found!

Top