Share folders via Samba without a password – easy! June 3, 2007Posted 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:
- 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
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.