Share folders via Samba without a password – easy! June 3, 2007
Posted by amazingrando in Linux Tips, Windows-Linux Transition.trackback

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:
- In a terminal type
sudo gedit /etc/samba/smb.conf(kubuntu users type kdesu kate /etc/samba/smb.conf) - Find the ### Authentication ### section (might be called Administration in older versions of Samba), where it says security = user
- Change it to
security = shareand make sure the line does not start with a semicolon. If it does, remove it. - A few lines down from that you’ll see
; guest account = nobodyRemove the semicolon at the beginning of the line. - 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 - Save the file and quit gedit
- 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!
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.
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!
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
Great help, thanks!
red try this:
where share is the path to the shared folder
opps.. that should be
sudo chown nobody Share
and you can
sudo chmod 777 Share
too.
[…] 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 […]
this was very helpful. thanks!
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?
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
I would like to see a continuation of the topic
Thanks for the reminder of “guest ok = yes”!
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.
Many thanks, been trying to do this for months!
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!
thank you – excellent explanation!
Excellent work.
Ubuntu Hardy Heron Beta doesn’t seem to have the “Share Folder” context menu, and this worked like a charm. Thanks
~Will
Been trying to get to this point since fall of 2005. Thank you!
you are mean to me onnn cccclllluuuubbbbppppeeeeennnnnnnggggguuuuuiiiinnnn
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.
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!
i tried this, but i can’t find the shared folder with my windows PC.
is there something i did wrong?
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
Difficult disks and solid-state drives are utilized for internal storage.
[…] The Penguin Trail: Share folders via Samba without a password – easy! […]
[…] Share folders via Samba without a password – easy! […]
instead of Browsable shold be BrowsEable
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.
Thank you, author and thorn
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.
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.
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.
Lovely blog you haave