jump to navigation

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

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

samba.gif

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.

Enjoy!

Comments»

d351GuJu's avatar 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.

wacb's avatar 2. wacb - August 14, 2007

Wow!

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!

red's avatar 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?

-red

M's avatar 4. M - October 14, 2007

Great help, thanks!

thorn's avatar 5. thorn - October 23, 2007

red try this:

sudo chown Share nobody

where share is the path to the shared folder

thorn's avatar 6. thorn - October 23, 2007

opps.. that should be

sudo chown nobody Share

thorn's avatar 7. thorn - October 23, 2007

and you can

sudo chmod 777 Share

too.

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 […]

vinz's avatar 9. vinz - November 22, 2007

this was very helpful. thanks!

Elvis's avatar 10. Elvis - December 17, 2007

hi,

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?

Elvis's avatar 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

Maximus's avatar 12. Maximus - December 20, 2007

I would like to see a continuation of the topic

STEREO's avatar 13. STEREO - January 22, 2008

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

hayfay's avatar 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.

Alex's avatar 15. Alex - February 9, 2008

Many thanks, been trying to do this for months!

Heikki Hakala's avatar 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!

Adi Daniel's avatar 17. Adi Daniel - March 20, 2008

thank you – excellent explanation!

Will's avatar 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

~Will

BLTicklemonster's avatar 19. BLTicklemonster - April 10, 2008

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

123best123's avatar 20. 123best123 - April 18, 2008

you are mean to me onnn cccclllluuuubbbbppppeeeeennnnnnnggggguuuuuiiiinnnn

Kees's avatar 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.

Ballboy's avatar 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!

Cheers!

roel's avatar 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?

dsdd's avatar 24. dsdd - July 30, 2013

Except it does not work…
[ddddd]
comment = xxxx
path = /xx/attachment
;force user = xxx
;force group = xx
writable = yes
public = yes
guest ok = yes
guest only = yes
guest account = nobody
;write list = clarify
;read only = no
create mask = 0664
directory mask = 0775
browsable = yes

homepage's avatar 25. homepage - August 6, 2013

Difficult disks and solid-state drives are utilized for internal storage.

26. Instalación y configuración de Samba en Debian Jessie | Attack and Release! - August 22, 2013

[…] The Penguin Trail: Share folders via Samba without a password – easy! […]

27. Share folders via Samba without a password | Guru - September 8, 2013

[…] Share folders via Samba without a password – easy! […]

nemam@emila.org's avatar 28. nemam@emila.org - December 29, 2013

instead of Browsable shold be BrowsEable

Spanky's avatar 29. Spanky - February 3, 2014

Welcome to 2014 🙂

I changed from passwords to this no-passwords and back (on one share; on one workstation, using the above help. Thanks.

My observations were: It takes a few minutes (both ways) for everything to update, and that’s after you remember save the file and restart samba.

Some sub-folders would view, and some not. I found some were set to no one, for the folder view/bit (so OFF). I could have selected the main Samba share per folder, and told it to apply to the subs, via the GUI (Mate’s Caja AKA the file manager), or you can do the command line thing(as above). In either case the choices for permissions are deep and that’s not a bad thing. Just be sure you understand your choices.

Use passwords for things you do not want WiFi hackers to see. Don’t share some things at all. Use shares accordingly.

Alex's avatar 30. Alex - June 16, 2014

Thank you, author and thorn

peli products's avatar 31. peli products - December 23, 2016

Hiya, I’m really glad I have found this info.
Today bloggers publish only about gossips and net and
this is really annoying. A good site with exciting content, that’s what I need.

Thanks for keeping this web-site, I’ll be visiting it.

Do you do newsletters? Can not find it.

Gorooos's avatar 32. Gorooos - August 26, 2018

You are assuming everybody has gedit and knows what it is. You’d be wrong. They don’t. You need to explain what gedit is and what to do if you don’t have it.

rohit's avatar 33. rohit - July 16, 2019

Hello amazingrando,
Can you please explain about windows sharing directory using SMB that don’t require userId and Password.

I am trying to share file from “Windows Server to Linux Machine” but without Id and Password it fails to copy file.

Pierre M's avatar 34. Pierre M - March 9, 2025

Lovely blog you haave


Leave a comment

Design a site like this with WordPress.com
Get started