Question

Is there a way to mount a Linux directory from a different PC to your local Linux PC? How?

Was it helpful?

Solution

Yes, it's called NFS. You might also want to check out sshfs which is pretty nice.

OTHER TIPS

sshfs is very nice, and easy to use

sshfs user@remotesystem:/remote/dir /some/local/dir

You need to be a bit more specific. You can use NFS.

Depending on what distro you're using, you simply edit the /etc/exports file on the remote machine to export the directories you want, then start your NFS daemon.

Then on the local PC, you mount it using the following command:

mount -t nfs {remote_pc_address}:/remote/dir /some/local/dir

Use the man utility for more information:

man exports (Examples of configuring directories for export are on the bottom of this manual page.)

NFS is handy since it's built-in and easy to configure, but the 2 common implementations (NFSv2 and NFSv3) don't translate usernames between the systems; user IDs are used instead. This requires you to use a central auth system such as LDAP so tha tcommon user IDs can be maintained.

sshfs requires you to connect as a single user and so accesses are always done (and consequently, can only be done) as that user.

cifs in a * nix-to-* nix connection (via Samba) both translates usernames and follows standard *nix permissions. As well, it is more flexible in that it allows you to perform ownership/permission transformation on creation of a new file or directory. It is, however, much more complex to configure.

sshfs works pretty well for me.

sudo sshfs -o allow_other root@1.2.3.4:/directory local_directory

remote machine ip : 1.2.3.4

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top