How to access file path from another server?

Hi there,

Say I have Server A and B,

how do I configure A with path aaa/bbb/ccc

to be able to access by Server B with aaa/bbb/ccc/<content>

You would need to share from Server A the path /aaa/bbb/ccc
Then you can mount it from Client B by naming the server and share as device in your mount command.

The usual method would be Network File System (NFS) but there could be others and implementation varies between flavours, so we would need to know what OS and version are you using?

Can you show us the output from uname -a

Kind regards,
Robin

Hi there,

I only have got two Operating system.

  1. AIX 6.1
  2. 2.6.32-358.el6_x86_64

How do I create a file share between the same set of operating system.

That depends: the suggested NFS comes in 4 different versions and first you need to decide which one you want to use. In practice you probably will use either NFS3 or NFS4, but this decision you will have to make. Both have their pros and cons and you need to decide which is better suited to your cause.

Then you will have to decide, from which system you want to export the share and which system should mount this share. The methods of achieving either are different in AIX and Linux.

So tell us what you want to do and we can tell you how to do that.

I hope this helps.

bakunin

Hi there,

I want to mount the file share on red hat linux 6.1 and share across other red hat linux 6.1 for a start.
How do I achieve that?

Thanks for advise.

NFS sharing node:

yum install nfs-utils
vi /etc/exports # and add the share entries there.

# Example:
# that allows any node in the 192.168.0.0 network to connect to /share

/share 192.168.0.0/24(rw,no_root_squash)

service rpcbind start
service nfs start

# To start at boot time
chkconfig rpcbind on
chkconfig nfs on

NFS mounting share node:

yum install nfs-utils
service rpcbind start
service netfs start
chkconfig rpcbind on
chkconfig netfs on

mount -t nfs sharing_node_ip_or_fqdn:/share /local/path/to/mounting/point/dir


# If you want the mounting to be done at boot for the node, edit the /etc/fstab
# Example:
sharing_node_ip_or_fqdn:/share /local/path/to/mounting/point/dir nfs defaults 0 0

Open the ports necessary if you are using a firewall.

1 Like

Hi Aia,

So that means I just need to call /share from another node within the same subnet and it will work for your nfs sharing mode method?

---------- Post updated at 05:57 AM ---------- Previous update was at 01:54 AM ----------

Hi there,

Is it possible to specific the NFS security restricted to particular host and by UID and GID?

Another thing is what is the difference between root squashing, nosuid, noexec options?

How do I access through UID and GID through manipulation?

Hello,

Root squash

Root squash is a reduction of the access rights for the remote superuser (root) when using identity authentication
(local user is the same as remote user). It is primarily a feature of NFS but may be available on other systems as well.

This problem arises when a remote file system is shared by multiple users. These users belong to one or multiple groups.
In Unix, every file and folder normally has separate permissions (read, write, execute) for the owner
(normally the creator of the file), for the group to which the owner belongs, and for the "world" (all other users).
This allows restriction of read and write access only to the authorized users while in general the NFS server must also be protected by firewall.

A superuser has more rights than an ordinary user, being able to change the file ownership, set arbitrary permissions, and
access all protected content. Even users that do need to have root access to individual workstations may not be authorized
for the similar actions on a shared file system. Root squash reduces rights of the remote root, making one no longer superuser.
On UNIX like systems, root squash option can be turned on and off in /etc/exports file on a server side.

After implementing the root squash, the authorized superuser performs restricted actions after logging into an NFS server directly
and not just by mounting the exported NFS folder.

2nd:
the nosuid, noexec and others are options which you can pass to the mount command (which performs the actual mounting).

Regards

It will, if a few criteria are met by all the involved nodes. Which criteria these are depends on the version of NFS you want to employ as i said already several posts above. In general: you need certain daemons to run but which that are depends on the version of NFS, because different versions need different daemons and you need certain open ports (but which these are again depends on the version you want to use) and a few other things too.

As you didn't answer which version you want to use no general answer to your question can be given.

Yes, but again: depending on the version of NFS you want to use there are different methods used.

I hope this helps.

bakunin

I think the /share in the previous post is the exported(=shared) directory on the NFS server. The given /share line is not a command; it is an entry in the /etc/exports file. The command exportfs -av activates the lines in the exports file.
On the NFS client(s) the mount command mounts the server's exported share to a local directory. Then all files in the mounted directory are located on the NFS server.
The export works on host(ip, network) level. Once mounted, the file owner and permissions decide on UID/GID level, just like the local files.