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 setclient 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
--
Hi, The login script is just a DOS batch file. Login as Administrator, browse to //server/netlogon and create/edit users.bat with Notepad or Windows Write. Make sure you save it as plain text. This is part of mine: REM Clear previous mappings if present. NET USE * /DEL /YES REM Set the workstation's time. NET TIME \\server /SET /YES REM Map the user's home directory. NET USE H: \\server\home I hope this gets you started. Sandy McCarthy (sandymccarthy@abesco.net) wrote:> > 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 ><SNIP> -- Assured Computing, Inc. When you need to be sure. http://www.assuredcomp.com/ P.O. Box 40814 Eugene, OR 97404 Voice - 541-868-0331 FAX - 541-463-1627
Hi Sandy, You should hit "Reply All" to keep our exchange on the list. At least until they get it fixed. Whether you use SuSE's version or the latest is up to your situation. If you are running into bugs, then get the latest. In my case, I know there are outstanding bugs but I haven't run into any of them. Are your workstatons XP/2000, Win98 or mixed? If XP/2000 then The user is in a variable. It's up you to learn DOS batch file programming. If Win98 then You will need to set logon script = %u.bat In each user's batch file set variables that determine which group they are in and call the main login script. If it's a mixed environment then It's a little messy but once it's setup adding and changing users is almost painless. Good luck. Sandy McCarthy (sandymccarthy@abesco.net) wrote:> > At 16:46 01/07/2004, you wrote: > >Hi, > > > >The login script is just a DOS batch file. Login as Administrator, browse to > >//server/netlogon and create/edit users.bat with Notepad or Windows Write. > >Make sure you save it as plain text. > > > >This is part of mine: > > > >REM Clear previous mappings if present. > >NET USE * /DEL /YES > >REM Set the workstation's time. > >NET TIME \server /SET /YES > >REM Map the user's home directory. > >NET USE H: \serverhome > > > >I hope this gets you started. > > Thanks for that. The * /Del /Yes command is great. > > Is it possible to run seperate login scripts for groups or individual users? The > users.bat seems > to run for all but I would like to have the flexability to run others like Novell can > do. > > Also what advantages do I get for upgrading to version 3 or should I just stick to what > Suse is downloading. > > Thanks > > Sandy > -- > >-- Assured Computing, Inc. When you need to be sure. http://www.assuredcomp.com/ P.O. Box 40814 Eugene, OR 97404 Voice - 541-868-0331 FAX - 541-463-1627