jump to navigation

Share folders via Samba without a password – easy! June 3, 2007

Posted by amazingrando in Linux Tips, Windows-Linux Transition.


Coming from the Windows world to Linux, one of the first things I wanted to do was to share directories on Ubuntu with my Windows laptop to easily transfer files. In Windows I can just right click a folder, go to sharing, and enable it. No users and passwords to set up. It goes without saying that this is not secure and you want to be careful doing it, but it’s a great way to share files between computers at home.

Sadly, it’s not yet that easy to do this in Ubuntu (let me know if there’s a simple way to do it with other distros). Ubuntu makes it easy to install the samba server. If it’s not already installed, you can right click on a directory and try to share it. It will ask you to install samba. You can also use sudo apt-get install samba or via the add/remove programs under the application menu.

Ubuntu, however, isn’t able to set it up for anyone to access without logging in, yet. It will only share with a login and password. So, to do this you’ll need to edit your /etc/samba/smb.conf file. Here’s how share a folder without a password or login:

  1. In a terminal type sudo gedit /etc/samba/smb.conf (kubuntu users type kdesu kate /etc/samba/smb.conf)
  2. Find the ### Authentication ### section (might be called Administration in older versions of Samba), where it says security = user
  3. Change it to security = share and make sure the line does not start with a semicolon. If it does, remove it.
  4. A few lines down from that you’ll see ; guest account = nobody Remove the semicolon at the beginning of the line.
  5. Scroll to the very bottom of the file and put in the following, adjusted for your own system[Share name]
    writable = yes
    path = /path/to/directory
    public = yes
    guest ok = yes
    guest only = yes
    guest account = nobody
    browsable = yes
  6. Save the file and quit gedit
  7. In the terminal restart the samba server to reload the conf file sudo /etc/init.d/samba restart

That should do it. If you want to try a more sophisticated way to configure shares, there is a GUI application called gsambad. I’ve found it overkill for just doing a simple share, but for others it might be quite useful. In Ubuntu you can download it from add/remove programs.


About these ads


1. d351GuJu - June 11, 2007

Thanks so much for this info! Turned out to be very helpful when a friend of mine wanted couple of files off of my desktop machine.

2. wacb - August 14, 2007


That was so simple and easy! Thanks so much. I had a look at a bunch of other sites on the web to try and figure out how to share with no pwd and it was far more complicated than this. Thanks!

3. red - October 12, 2007

Wow, thanks a lot. I seem to have run into a problem though. Using the same configuration, I am unable to write to the folder from the windows machine, even though I am able to read from it. Any ideas? From windows I get an error “Access is Denied, make sure the disk is not full or write-protected and that the file is not currently in use”

Any pointers?


4. M - October 14, 2007

Great help, thanks!

5. thorn - October 23, 2007

red try this:

sudo chown Share nobody

where share is the path to the shared folder

6. thorn - October 23, 2007

opps.. that should be

sudo chown nobody Share

7. thorn - October 23, 2007

and you can

sudo chmod 777 Share


8. Tongue-tied! » Blog Archive » Password-less filesharing via Samba - November 22, 2007

[...] a home network. For those who want to share files without having to go through password security, here’s a helpful link. Posted in Websites, Reviews | Leave a [...]

9. vinz - November 22, 2007

this was very helpful. thanks!

10. Elvis - December 17, 2007


I’ve followed your instruction to the dot but my xbox (xmbc) still asks for user id/password. Sorry I have no other window machines for testing. Any idea why this is happening?

11. Elvis - December 17, 2007

sorry, it turns out the problem is not my samba, but rather the mounting option related to my vfat partition (which is smb-shared). The default fstab option in ubuntu 7.10 for a vfat partition is:

defaults,utf8,umask=007,gid=46 0

I needed to change it to:

users,gid=users,umask=0000,utf8=true 0 0

after umount/mount, restarting smb, the share is accessible without authentication as per your guide.

thank you, and sorry about that

12. Maximus - December 20, 2007

I would like to see a continuation of the topic

13. STEREO - January 22, 2008

Thanks for the reminder of “guest ok = yes”!

14. hayfay - January 27, 2008

Thanks for showing the “guest account = nobody” option. The “nobody” user is automatically created in most popular distros and is usually the default account used by samba when “guest = ok” is set in smb.conf.

15. Alex - February 9, 2008

Many thanks, been trying to do this for months!

16. Heikki Hakala - February 25, 2008

I had problems when doing folders under folders. Folder which were created with owner nobody didn’t allow new folders.
I think that this is not possibly the most stylish way to do it put i just changed the
guest account = nobody -> guest account = myusername
after that everything worked fine!

17. Adi Daniel - March 20, 2008

thank you – excellent explanation!

18. Will - March 28, 2008

Excellent work.

Ubuntu Hardy Heron Beta doesn’t seem to have the “Share Folder” context menu, and this worked like a charm. Thanks


19. BLTicklemonster - April 10, 2008

Been trying to get to this point since fall of 2005. Thank you!

20. 123best123 - April 18, 2008

you are mean to me onnn cccclllluuuubbbbppppeeeeennnnnnnggggguuuuuiiiinnnn

21. Kees - June 25, 2008

Thank you very much, nice simple instructions that are easy to follow.

This managed to sort out a problem with one of our reporting databases which needed to connect across.

22. Ballboy - July 12, 2008

Thanks for the very clear guide but it was Elvis’s comment that helped me out, which also explains why some drives worked and others didn’t:

..>defaults,utf8,umask=007,gid=46 0
..>I needed to change it to:
..>users,gid=users,umask=0000,utf8=true 0 0

Thank you Elvis!

Also, when following your guide if I remove the semicolon before ‘samba = share’ my network can’t be found by the client machine… strange, i would like to know why this is if anyone knows… anyhoo, I’m now happily networking away!


23. roel - August 8, 2008

i tried this, but i can’t find the shared folder with my windows PC.
is there something i did wrong?

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


Get every new post delivered to your Inbox.

%d bloggers like this: