Centos – samba to ask username password before listing shared folders

centossamba

I setup CentOS and samba on a VM. I configured smb.conf and I can browse \ip_address and see files read and write. Up to here is fine.

What I want to do is (I did it before but I forgot how to do it) when I type \ip_address on windows machine I want samba to ask me username and password. Then I'll be able to see all shared folders on samba

I use the config below but samba never asks me username and password and this is a fresh installation and I don't have any saved passwords.

Samba version 3.6.9-151.el6

[web]
  comment = Web
  browsable = yes
  path = /var/www/html
  valid users = @ergec
  force group = root
  force user = root
  create mask = 0660
  directory mask = 0771
  writable = yes
  read only = No
  create mask = 00
  force create mode = 0770
  force directory mode = 0770
  guest ok = Yes
  vfs objects = recycle

Best Answer

The line guest ok = yes allows access for everyone, remove it. Of course, the global configuration will need appropriate options as well (e.g. security = user ) and you must have Samba users created. Read the Samba docs (especially the smb.conf man page).