Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

samba conf.

Status
Not open for further replies.

mohfa

Technical User
Apr 25, 2002
6
MY
i've set my samba server. I need to know how to set folders/files to be viewed by the allowed users only. e.g
[account] can only be browse & edit by john & david
[admin] can only be browse & edit by maria & joe
all of them are using different pc at all time e.g
john on either PC1 or PC2
joe on either PC1 or PC3
i've try to map drive but when they used diffent pc i have to do the drive mapping again. The question is can i make it automatically mapping drive when the user login the pc? and how to? i'm using domain login.

TQ.
 
Yes you can configure Samba to map network drives based on usernames.

"Samba supports the execution of Windows logon scripts, (.BAT or.CMD)..." [Eckstien,Collier-Brown & Kelly] p192, "using Samba"

While I could try to describe how to do this you would be much better off referring to "Using Samba" which is published by O'Rielly.

Free Documentation is also available at search for the section "logon script (G)"

Hope this helps.

Regards,
MfItDept
 
When you say that you have to do the drive mapping again, do you mean that on each different computer you have to manually mount the samba share? although you are using samba server, what desktop OS are you using, maybe I can give you more info on setting permanent mappings Mixed Linux/Win2000 Network Administrator
 
You have a Windows NT/2000 domain? Here's what you do...

First you should have the Samba server join the domain. Create a computer account in the domain for the Linux server. If this is an Active Directory domain, make sure to select "All Pre-Windows 2000 computers to use this account", when creating the Computer Account in the domain. Next, join the Linux server to the NT domain...

smbpasswd -j domain_name -r windows_pdc

The domain is the NetBIOS name of the domain and the windows_pdc is the NetBIOS name of the Windows Primary Domain Controller.

Now your domain controllers can authenticate users for your Linux machine.


In the smb.conf file, you can allow only specific users to access shares using the "valid users" directive.

[share]
path = /home/chris
writeable = yes
valid users = chris

In the above example, only the user account "chris" can access this share. The "chris" account must exist in the Windows domain. You should also create the "chris" account in /etc/passwd and apply the proper permissions on the /home/chris directory.


As far as the drive mappings go, you can create login scripts for Windows domain users. Create a text file in the SYSVOL share on a Windows domain controller (SYSVOL is for Windows 2000 and NETLOGON is for Windows NT). In that text file, add the commands to map the shares on the Samba server....

net use K: //samba_name/share_name

Save this text file as a batch file. Call it something like login.bat. Add login.bat to each user accounts profile where it says "Login Script". Its basically the same in either NT or 2K. You should be able to find it.


Does this answer all of your questions?

ChrisP ---------------------------------------
If someone's post was helpful to you, please click the box "Click here to mark this post as a helpful or expert post".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top