[Samba] Samba login scripts

Sandy McCarthy sandymccarthy at abesco.net
Thu Jul 1 15:26:58 GMT 2004


Sorry to post a newbie question which may of been asked before but I am struggling to get my head around how to get login scripts to work using samba.

I am currently testing Suse Standard Server 8 which comes with Samba 2.2.8a-UL. Using the Suse graphical web interface I can setup users and groups and also setup smb shares. I have told the linux server to act as a PDC. I can't find anywhere to configure login scripts. Also when I make changes in the graphical interface, it doesn't seem to update right away. Is this due to samba needing to be restarted after every change. If so how does this affect currently connected users?

Back to login scripts, Drive  p: gets mapped automatically which is referenced in my smb.conf (copy below)

[global]
add user script=/usr/sbin/addsmbmachine2ldap %m
admin users=administrator
character set=
client code page=437
domain admin group=@ntadmin root
domain logons=Yes
domain master=Yes
encrypt passwords=Yes
ldap admin dn=uid=cyrus,dc=abesco,dc=net
ldap del only sam attr=Yes
ldap filter=(&(uid=%u)(objectclass=sambaAccount))
ldap port=389
ldap server=localhost
ldap ssl=No
ldap suffix=dc=abesco,dc=net
logon drive=p:
logon home=\\%L\%U
logon path=\\%L\%U\.msprofile
logon script=users.bat
map to guest=Bad User
os level=255
preferred master=Yes
printcap name=CUPS
printer admin=@ntadmin
printing=CUPS
security=user
socket options=SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY
time server=Yes
unix extensions=Yes
username map=/etc/samba/smbusers
veto files=/*.eml/*.nws/riched20.dll/*.{*}/
wins support=Yes
workgroup=ABESCO

[netlogon]
comment=Network Logon Service
path=/var/lib/samba/netlogon
browseable=No

[homes]
browseable=No
comment=Home Directories
inherit permissions=Yes
read only=No
valid users=%S

[print$]
comment=Printer Drivers
create mask=0664
directory mask=0775
force group=ntadmin
path=/var/lib/samba/drivers
write list=@ntadmin root

[printers]
browseable=No
comment=All Printers
create mask=0600
path=/var/tmp
printable=Yes

[Users]
comment=Share of all users
path=/home
writeable=Yes
inherit permissions=Yes
veto files=/aquota.user/groups/shares/

[Groups]
comment=Share of all groups
path=/home/groups
writeable=Yes
inherit permissions=Yes

[pdf]
comment=PDF generator
path=/var/tmp
printable=Yes
print command=/usr/bin/smbprngenpdf -J '%J' -c %c -s %s -u '%u' -z %z
create mask=0600

[sales]
comment=sales
path=/home/groups/sales
writeable=Yes
inherit permissions=Yes
browseable=No

[sage]
comment=sage
path=/home/groups/sage
writeable=Yes
browseable=No
inherit permissions=Yes

[central]
comment=central
path=/home/groups/central
writeable=Yes
browseable=No
inherit permissions=Yes

[Contracting]
comment=Contracting
path=/home/groups/contracting
writeable=Yes
browseable=No
inherit permissions=Yes

There is also a file called users.bat which appears to be called (copy below)

@echo off
rem  Time setting disabled as not possible as none local Administrator on
rem  Microsoft Windows(r) NT based systems without special permissions.
rem  You must assign 'Change the system time' to the user on the workstation
rem  so that NET TIME can work.
rem net time /set /yes
rem  Add a drive for the users home.
net use p: /home

Now I have also found a .bat file for each default group created but I have added net use command to these but they don't appear to be used. I have added net use commands to the above users.bat file and they do map drives but when I remove a user from a group it still maps the drive. What is the best way of providing drive mappings to users and groups?

Also I notice that Samba version 3 is available. Should I be upgrading? I have carried out an online update from suse server and version 2.2.8a-UL is the most up to date copy.

Thanks and sorry of these questions have been asked before.

Regards

Sandy
--  


More information about the samba mailing list