Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there. I have samba primary domain controller up and running. It automatically creates a network shared drive (H on every windows computer according to each user. All that is good. I also have a public share called All Users configured in samba, how would I go for adding another logon script for it so windows users will get the mapped drive without having to manually configure it on each computer????
Thanks
Below my smb.conf
Quote:
[global]
workgroup = TTPDC
netbios name = ttsvr
server string = Samba Domain Controller
passdb backend = tdbsam
security = user
username map = /etc/samba/smbusers
name resolve order = wins bcast hosts
domain logons = yes
preferred master = yes
wins support = yes
Instead of path = /home/shares/allusers
make a directory /shares/allusers and chmod -R 777 /shares as root
Change the path to /shares/allusers
read only = No
browsable = no
Get rid of [public] - it does not reference any directory
[public]
browseable = yes
public = yes
Restart samba and you should see allusers appear in your Windows machines
In the /home/samba/netlogon directory create a user.bat file where user is the name of an individual user name.
Add your share definitions
net time \\ttsvr /set /yes
net use L: \\ttsvr\allusers
do a unix2dos on this file so Windows can read it properly
To list shares that are available from the configured Samba server, execute the following command:
$ smbclient -L yourhostname
You should see a list of shares available on your server. If you do not, then something is incorrectly configured.
Instead of path = /home/shares/allusers
make a directory /shares/allusers and chmod -R 777 /shares as root
Change the path to /shares/allusers
read only = No
browsable = no
Get rid of [public] - it does not reference any directory
[public]
browseable = yes
public = yes
Restart samba and you should see allusers appear in your Windows machines
Do I need to add/change/edit #Default Logon at all???
You should get samba swat running. There is a wealth of information regarding how to do all this there.
e.g.
logon script (G)
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.
The script must be a relative path to the [netlogon] service. If the [netlogon] service specifies a path of /usr/local/samba/netlogon, and logon script = STARTUP.BAT, then the file that will be downloaded is:
/usr/local/samba/netlogon/STARTUP.BAT
The contents of the batch file are entirely your choice. A suggested command would be to add NET TIME \\SERVER /SET /YES, to force every machine to synchronize clocks with the same time server. Another use would be to add NET USE U: \\SERVER\UTILS for commonly used utilities, or
NET USE Q: \\SERVER\ISO9001_QA
for example.
Note that it is particularly important not to allow write access to the [netlogon] share, or to grant users write permission on the batch files in a secure environment, as this would allow the batch files to be arbitrarily modified and security to be breached.
This option takes the standard substitutions, allowing you to have separate logon scripts for each user or machine.
This option is only useful if Samba is set up as a logon server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.