LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-11-2010, 12:33 PM   #1
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Rep: Reputation: 7
openSuSE 11.2 SAMBA server issue


Hi everyone.

I have several shares (see smb.conf below). Each setup fairly similarly, and several groups. My end goals are:

1) to have the [public] share automatically map as the P: drive to members of the employees group
2) to have the [tech] share automatically map as the t: drive to members of the tech group
3) to have the [sales] share automatically map as the s: drive to members of the sales group
4) to have the [customerSupport] share automatically map as the r: drive to members of the support group
5) to have the users home directory automatically map as the u: drive to all members of the domain.

How it stands now is, everyone's home directories auto map correctly to the U: drive...as specified in my smb.conf file. Can someone please help me understand how to get the above listed drives to auto map to users when they first log in? This is easily done on a Windows AD domain controller, but I am fairly new to a Samba PDC. I'm not sure if this is relevant, but this samba server is also an LDAP server. I have ldapsmb tools installed that allow easier management between the 2 types of accounts (LDAP and Samba).

Code:
[global]
   #domain specific
	domain master = Yes
	domain logons = Yes
	encrypt passwords = True
	netbios name = Samba PDC
	local master = Yes
	log file = /var/log/samba/%m
	log level = 1
	os level = 65
	preferred master = Yes
	security = user
	server string = LDAP-SMB Server
	syslog = 0
	wins support = Yes
	workgroup = nmm.local

   #Security
	lanman auth = No
	lm announce = No
	min protocol = NT1
#	hosts allow = 10.245.106.0/24 10.45.106.0/25 127.0.0.1
	#block everyone not in the above subnet
#	hosts deny = ALL
	

   #LDAP specific
	ldap admin dn = cn=admin,dc=nmm,dc=local
	ldap group suffix = ou=group
	ldap idmap suffix = ou=Idmap
	ldap machine suffix = ou=Machines
	ldap passwd sync = Yes
	ldap suffix = dc=nmm,dc=local
	ldap user suffix = ou=people
	idmap backend = ldap:ldap://127.0.0.1
	passdb backend = ldapsam:ldap://127.0.0.1

   #Machines, Users, Groups
	add machine script = /usr/sbin/ldapsmb  -a --homedir /var/lib/nobody --shell /bin/false -wks %m$

   #Roaming Profiles
	#logon path = \\%L\Profiles\%U              set it to emtpy (below) to use local profiles
	logon drive = U:
	logon home = \\%L\%U
	dont descend = /proc,/dev,/etc,/lib,/lost+found,/initrd
	#wins server = 

[netlogon]
	comment = Network Logon Service
	path = /var/lib/samba/netlogon
	
[homes]
	comment = Home Direcories
	valid users = %S
	#, %D%w%S i took this out of valid users, for testing
	browseable = No
	read only = No
	inherit acls = Yes

[profiles]
	comment = Network Profile Service
	path = %H
	read only = no
	store dos attributes = Yes
	create mask = 0600
	directory mask = 0700
	browseable = no

[public]
	comment = Public drive NOTHING IS SACRED!
	inherit acls = Yes
	path = /mnt/public
	read only = No
	writeable = Yes
	create mode = 0660
	directory mode = 0770
	valid users = @employees

[tech]
	comment = Tech department only
	inherit acls = Yes
	path = /mnt/tech
	read only = No
	writeable = Yes
	create mode = 0660
	directory mode = 0770
	valid users = @tech

[sales]
	comment = Sales department only
	inherit acls = Yes
	path = /mnt/sales
	read only = No
	writeable = Yes
	directory mode = 0770
	create mode = 0660
	valid users = @sales

[customersupport]
	comment = Customer Support department only
	inherit acls = Yes
	path = /mnt/customerSupport
	read only = No
	writeable = Yes
	directory mode = 0770
	create mode = 0660
	valid users = @support
 
Old 10-12-2010, 12:06 PM   #2
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Original Poster
Rep: Reputation: 7
script

so I added this in the global section:

logon script = employees.bat

and created a batch file (In Windows), copied it to the samba server into the directory listed in the [netlogon] section:

path = /var/lib/samba/netlogon/employees.bat

Below is the logon script:
Code:
#  Reset the current time to that shown by the server.
#  We must have the "time server = yes" option in the
#  smb.conf for this to work.

echo Setting Current Time...
net time \\SAMBA /set /yes

#  Here we map network drives to shares on the Samba
#  server
echo Mapping Network Drives to Samba Server...
net use p: \\samba\public
From here I restarted the smb and nmb services and tried to login on a windows machine, but the script still does not run. Can anyone see any mistake I have made?

Rich
 
Old 10-13-2010, 11:51 AM   #3
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Original Poster
Rep: Reputation: 7
anyone?
 
Old 10-14-2010, 12:37 PM   #4
luvshines
Member
 
Registered: Apr 2009
Posts: 74

Rep: Reputation: 16
Though I haven't tried that option, but from man page got these relevant extracts:
Code:
This parameter specifies the batch file (.bat) or NT command file (.cmd) to be downloaded and run on a machine when a user successfully logs in.
The file must contain the DOS style CR/LF line endings. Using a DOS-style editor to create the file is recommended.
I would suggest:
1. Make sure the .bat file has been created with some windows editor
2. Remove echo, since the file has to be executed on windows side which I don't think would understand echo command

Maybe my suggestions are not relevant, but you can give them a try

Last edited by luvshines; 10-14-2010 at 12:38 PM. Reason: Fixed typo
 
Old 10-20-2010, 10:58 AM   #5
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Original Poster
Rep: Reputation: 7
The batch file was created on a Windows machine and scp'ed to the samba server. it has 0777 permissions on it. Im pretty sure echo is a recognized windows command. This login script was a sample I copied from MS technet. Never the less, I did try it without both echo lines and still no go.

Last edited by unassassinable; 10-20-2010 at 11:02 AM. Reason: missed some info
 
Old 10-31-2010, 02:25 PM   #6
luvshines
Member
 
Registered: Apr 2009
Posts: 74

Rep: Reputation: 16
Quote:
Originally Posted by unassassinable View Post
The batch file was created on a Windows machine and scp'ed to the samba server. it has 0777 permissions on it. Im pretty sure echo is a recognized windows command. This login script was a sample I copied from MS technet. Never the less, I did try it without both echo lines and still no go.
Did you try running the command written in bat file on the Windows terminal ?
Is the server reachable by the name "samba" ?
 
Old 10-31-2010, 11:50 PM   #7
unassassinable
Member
 
Registered: Sep 2010
Posts: 46

Original Poster
Rep: Reputation: 7
I will attempt to run it from the windows machine in command prompt tomorrow. That's a good point...if it doesn't run locally, it wouldn't run remotely. The server is also reachable by doing \\samba.
Rich
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Server not found network issue - openSuSE 11.3 - 2 Linksys routers SakujoNoJidai SUSE / openSUSE 1 10-16-2010 02:41 AM
LXer: OpenSUSE 11.2 Samba Standalone Server With tdbsam Backend LXer Syndicated Linux News 0 01-11-2010 05:00 PM
WinXP(Pro) access to Linux OpenSuSE/SAMBA server? DarkFlame Linux - Server 6 12-02-2008 02:07 AM
OpenSuse 10.3 Samba Server questions jedilost1 Linux - Server 3 10-16-2008 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration