Home > Linux, Network > Sharing files and folders from Ubuntu PC with Windows Network Support

Sharing files and folders from Ubuntu PC with Windows Network Support


Do you believe that sharing files and folders across your network from your Ubuntu PC is every bit as easy as sharing files in Windows? Well, I dont. It might be because I dont know the appropriate method of sharing files in Ubuntu.

Here is the scenario. All users in the LAN, except me, are using Windows OS. Often, my friends complain that they are not able to access files in my laptop. These frequent complaints prompted me to have a look at the issue. So here is at how I resolved the issue.

  1. I found out that we need Samba for Windows network support.
  2. Install samba package by typing the following command
    sudo apt-get install samba
  3. Now edit the smb.conf file by the following command
    sudo vim /etc/samba/smb.conf
  4. Add the following text to the end of ‘smb.conf’
    [fileName]
    comment = Write something about the file here
    path =  /media/
    browseable = yes

    read only = yes

    guest ok = yes

    You will have to set the path to the file you desire to share.( eg. path= /media/disk)

  5. Change the security to share levelBy default the security will be set to user level, which will be usually commented :
    #security = user

    Remove the #( to make it as uncomment) and Modify it as :

    security = share
  6. Now the last step is to restart the network by typing the following comment
    sudo /etc/init.d/networking restart

The method told above worked fine in my system. If anyone knows a better way, please comment it here.

If you found the method a bit difficult, you can simply download the below file and paste it in /etc/samba. It is adviced that you keep a backup of the original copy of smb.conf.

Download here

My Conclusion

You can share Linux partitions like home, etc. by a mere right click. To share the Windows partitions, one need to add the following line to the global section of smb.conf

usershare owner only = false

Advertisements
Categories: Linux, Network Tags: , ,
  1. October 10, 2009 at 1:49 pm

    Another, much simpler method would be to right click on the folder you want to share, select “sharing options” and follow on screen instructions.

    Works every time, no command line…

    “Do you believe that sharing files and folders across your network from your Ubuntu PC is every bit as easy as sharing files in Windows?” -> Well I do!

    • October 10, 2009 at 2:11 pm

      I believe they will ask to edit the smb.conf file there too if u havent earlier set “usershare owner only = false” . Anyway when I tried to share by a mere right click, I got the following message
      “‘net usershare’ returned error 255: net usershare add: cannot share path /mnt/Res/Write as we are restricted to only sharing directories we own”

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: