LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2005, 08:03 AM   #1
billiejoex
Member
 
Registered: Oct 2005
Posts: 31

Rep: Reputation: 15
[Samba] Execute commands depending on user


I'm running Samba as Primary Domain Controller. I created a group called
"machines" containing the domain users and another one called "admin"
containing some root accounts. This is my share section of smb.conf:

### Shares
# public share:
[public]
path = /home/public
comment = full access
writable = yes
browsable = yes
[profiles]
path = /home/profiles
comment = Personal shares
writeable = yes
browseable = yes
create mask = 0600
directory mask = 0700
# execute a command everytime a user logs in
root preexec = /usr/bin/touch /home/_userIN
# execute a command everytime a user logs out
root postexec = /usr/bin/touch /home/_userOUT

I would like that when a user of the group admin logs into the domain a
command is executed on the server. I tried to add the line below but the
command is executed only if the user access the share and not when he logs
into the domain:

[test]
path = /dev/null
valid users = @admin
root preexec = /usr/bin/echo Hello!
 
Old 10-25-2005, 12:01 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The easiest way is probably to have a login.bat script that runs on the client to map the share, which in turn runs the exec command.
 
  


Reply



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
cannot execute some commands as an plain user! minike Slackware 5 09-03-2004 06:34 PM
BASH scripting; su to user, commands after dont execute Zero-0-Effect Programming 4 06-07-2004 11:09 AM
how can execute some commands when a user logs out rddreamz Programming 2 05-25-2004 03:00 PM
Can't execute commands when logged in as ordinary user.... murphaph Linux - General 3 04-05-2004 05:23 PM
KMail: execute command depending on message body linuxfond Linux - Newbie 0 01-31-2004 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:48 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