LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Samba shares with one non-password and 1 password protected dir (https://www.linuxquestions.org/questions/linux-newbie-8/samba-shares-with-one-non-password-and-1-password-protected-dir-4175494544/)

garfy 02-11-2014 09:43 AM

Samba shares with one non-password and 1 password protected dir
 
I'm trying to share 2 folders for all users without a password or login (sharelive and client), an another map should be shared with a login protection (bibliotheek)
How can I adjust my smb.conf for this?

This is my smb.conf file:
[global]
workgroup = My_DOM
netbios name = bacchus
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = share
guest account = nobody
null passwords = true
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
create mask = 0644
directory mask = 2777

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[client]
path = /media/client-partition/client
browseable = yes
writable = yes
guest ok = yes
available = yes
create mask = 0777
directory mask = 0777
force user = intranet
force group = intranet
[bibliotheek]
path = /var/www/bibliotheek/documenten
browseable = yes
writable = yes
guest ok = yes
available = yes
create mask = 0777
directory mask = 0777
force user = intranet
force group = intranet
valid users = bibliotheek
[sharelive]
path=/media/client-partition/sharelive
browseable=yes
writable=yes
guest ok=yes
available=yes
create mask=0777
directory mask=0777
force user=intranet
force group=intranet

Finlay 02-11-2014 11:49 AM

so to try to understand this.

are you wanting guest access read only and the login user will have read/write?

ericson007 02-11-2014 06:38 PM

Take out the guest ok linee on the share you want password protected and don't set permissions to 777 on the share. Use something like 760

garfy 02-12-2014 02:42 AM

I am trying to share the maps client and sharelive to all users without the use of a password.
The map bibliotheek should be shared with only one user: bibliotheek.

I removed the guest ok line ...

I did smbpasswd -a bibliotheek and smbpasswd -e bibliotheek but when I'm trying to use: net use z: \\<myip>\bibliotheek /user:bibliotheek <mypass>
I get the next error:
System error 1326 has occurred.

Logon failed: unknown user name or bad password.

Finlay 02-12-2014 02:06 PM

are the date and time on both computers set correctly?

ericson007 02-13-2014 01:43 AM

Is the bibliotheek user added to the samba host as well?

If not use

Code:

#useradd bibliotheek
Then the smbpasswd command


All times are GMT -5. The time now is 10:01 PM.