Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What I'm trying to do is to share my VM development web server's /www folder, to make it more convenient to transfer the HTML, PHP and web documents I have made to test on the web server.

Would I have to use Samba to do this? Or would there be a simpler solution since I am using Linux-Linux.

share|improve this question
1  
On a Linux-Linux environment, a better solution could be NFS: cyberciti.biz/faq/how-to-ubuntu-nfs-server-configuration-howto –  nwildner Jun 11 '13 at 21:06
2  
sshfs. Then all you need is sshd on the server which you probably already have. –  Stéphane Chazelas Jun 11 '13 at 21:25
    
You can use Midnight Commander to work with local and remote filesystems through ssh in two panes. In mc: cd sh://your_server and you're done. –  Deer Hunter Jun 12 '13 at 8:49

2 Answers 2

If you're looking for something light and easy to setup sshfs is by far the easiest to set up. Sshfs mounts remote directories through ssh and presents them as locally mounted directories & files. It sounds more complicated than it actually works out to be.

First make sure that you have sshfs installed on the system where you'll be wanting to create mounts. For example, say I have my laptop and a remote server. I'd install sshfs on my laptop so that I can mount directories locally on it, from the remote server.

Example

$ sshfs sam@skinner:/home/sam/docs ~/far_projects

$ ls -l ~/far_projects/
total 1260
drwxr-x--- 1 5060 users   4096 Mar 30  2004 acronyms
drwxr-xr-x 1 5060 users   4096 Nov 16  2008 articles
drwxr-xr-x 1 5060 users   4096 Nov 16  2008 bookmark_repository
drwxr-xr-x 1 5060 users   4096 Oct 14  2009 books
drwxr-xr-x 1 5060 users   4096 Nov 15  2008 cheatsheets
-rw-r--r-- 1 5060 users   6855 Feb 19  2009 cheatsheet.txt

When you're done with the mount you can use the command fusermount to unmount it.

$ fusermount -u ~/far_projects
$ ls ~/far_projects/
$ 

These types of mounts can even be integrated into /etc/fstab.

share|improve this answer

You can use NFS export to share a folder

On your Linux Server_1 where you want to share a folder do the following:

   echo /shared_folder *(rw,sync) >> /etc/exports

   /etc/init.d/nfs restart

Do the following on your linux server_2 where you need to mount the shared folder from server_1:

   mkdir /shared_folder

   mount -t nfs Server_1:/shared_folder /shared_folder
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.