No access to Samba shares

I'm thinking he doesn't have any samba users.

sudo smbpasswd -a <username>  
gksu gedit /etc/samba/smbusers  

This is not an answer, but more like a comment, since I don't seem to have the privilege to comment yet. I'm not surprised that your roommate uses Windows 7. I sometimes have trouble sharing files between Windows XP and Windows 7.

I used to work on an Windows XP computer with Ubuntu running in VMware, and transfer files through sharing via Samba. When I tried the same setup with Windows 7, no joy.

It seems like there's something that's changed in Windows 7. So unless you are having issues sharing with an Windows XP, I wouldn't exactly say Samba was more reliable 10 years ago.

reference here and/or try to get newer versions of Samba

http://wiki.samba.org/index.php/Windows7


I usually do it by editing the conf file. I did this: sudo nano /etc/samba/smb.conf, and added this at the end of the file.

[Shared]
     comment = My Files
     path = /home/me
     read only = yes
     write list = koanhead
     guest ok = yes

At 'write list' mention your system username, so that you only have write permission. On the windows machine type this at run: \\ip-of-the-samba-pc\shared. On ubuntu machine open file browser and type this at the location bar smb://ip-of-the-samba-pc/shared


You say you were able to make user-level access work. That sounds to me like it is merely your samba configuration that is wrong. In the olden days, I'd have said clear out the samba.conf, and make a simple one that suits your needs, a proper samba.conf doesn't need to be more than 10 lines, maybe.

Anyways, since then a simpler solution has emerged: install system-config-samba

sudo apt-get install system-config-samba

Before you begin you might like to reset the samba.conf to it's original state. To make sure no "hidden" syntax errors have snuck their way in during all the troubleshooting

The control panel is quite simple:

  • click the '+' sign
  • select directory
  • make visible (and writable?)
  • go to the 'Access' tab
  • choose 'Allow access to anyone'

An alternate (and slightly more proper) way of doing it:

  • create a *nix user named: guest (or whatever you like)
    • for security reasons make sure "guest" has /bin/false as login shell (unless you want the guest to be able to login through ssh etc. as well)
  • in the "Preferences" menu: select "Samba users"
  • make sure "guest" is on the list: if isn't create it.

then

  • in the "Preferences" menu: select "Server settings"
  • On the "Security" tab: by "Guest Account", select 'guest'

Now anyone who tries to log in anonymously will be assigned to the user 'guest', and thus will have whatever rights 'guest' has.

  • now create the share as described before, except instead of choosing "Allow access to everyone", merely select 'guest'.

make sure the *nix user 'guest' has sufficient rights to read and/or write in the shared folder.

Good Luck!

/B2S


In order for new Windows systems to access the current/old Ubuntu Samba shares, you need to enable password encryption (encrypt passwords = yes in the smb.conf).

The thing that has changed in Windows 7 is that they have put in a security requirement for Samba passwords to be encrypted. The same applies to XP if you have KB2536276 installed.

I went round & round with this issue on our network at work until I found the solution of changing that "no" to "yes" on encrypted passwords. This still works for a wide-open share that everyone has read/write access to with no password - even though you have no password, it still must tell Windows that the nonexistent password is encrypted for Windows to let you on there.

This answer is assuming you have everything else configured for Samba to work correctly, such as users (or the lack thereof) and permissions set.

For the open/easy share with no passwords etc, make sure you have security = share, guest account = nobody, and/or map to guest = Bad User in the conf.