LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 09-18-2012, 03:05 AM   #1
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
script to get who is accessing samba


hello,

i have a samba server on centos.and client on windows m/c .i need a script to get log of following activities -
1.accessing-ip and machine name-mac address of windows client machine
2.which m/c has opened which folder/file
3.if m/c has created folder and file or append existing file then log of all activies like m/c ip-user name.etc.

actually samba log does not give clear report as per requirement so iam preparing my script.so please give me guide line for script
 
Old 09-18-2012, 10:55 AM   #2
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
smbstatus should show you who's connected.

net usershare
net status shares
net status sessions

may also give useful information.

I don't about getting logs of folders / files created during the sessions.
 
Old 09-21-2012, 05:48 AM   #3
centos123
Member
 
Registered: Apr 2011
Posts: 397

Original Poster
Rep: Reputation: 16
i checked this but not getting any data...can u show me some example.
 
Old 09-21-2012, 11:19 AM   #4
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
I can't as I'm not running samba at the moment

Somebody else may be able to help
 
Old 09-25-2012, 05:16 AM   #5
youphak
LQ Newbie
 
Registered: Apr 2011
Posts: 14

Rep: Reputation: 0
the result as below:
# net status sessions "this is show users log in to samba "
[2012/09/25 17:01:03, 0] param/loadparm.c:7483(lp_do_parameter)
Ignoring unknown parameter "netbios"
PID Username Group Machine
-------------------------------------------------------------------
26878 user01 users user01-pc (::ffff:192.168.0.10)
25435 user02 users user02-pc (::ffff:192.168.0.61)
23577 user03 users user03-pc (::ffff:192.168.0.110)
# net status shares "this is show users share file on samba "
[2012/09/25 17:03:20, 0] param/loadparm.c:7483(lp_do_parameter)
Ignoring unknown parameter "netbios"

Service pid machine Connected at
-------------------------------------------------------
user01 25435 user01 Tue Sep 25 13:45:34 2012
user02 26878 user02-pc Fri Sep 21 08:50:13 2012
user03 23577 user03-pc Tue Sep 25 08:57:24 2012
 
  


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
accessing samba share nickraj Linux - Server 0 07-28-2007 09:52 AM
Samba and accessing Windows? Snump Mandriva 7 12-03-2006 09:21 PM
issues with mirc script accessing our php script dtra Linux - Software 2 07-02-2005 04:30 PM
Serv-U accessing Samba fmertus Linux - Networking 2 06-12-2003 07:53 PM
Accessing Samba Remotely vcheah Linux - Networking 14 05-17-2003 02:11 PM

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

All times are GMT -5. The time now is 02:03 AM.

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