LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-21-2017, 02:12 PM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 376

Rep: Reputation: Disabled
monitoring network stats and user stats


hi all,

made a sftp server and added a few users and they can upload/download to thier home folder but now i want to monitor the network traffic ie upload /download speed from each individual connections ie the host/ip of the users if not just a total upload/download and also what user is connected to the sftp server, what folder they have access to ie uploading to or downloading to

thanks,

rob
 
Old 11-22-2017, 03:25 AM   #2
robertkwild
Member
 
Registered: Feb 2015
Posts: 376

Original Poster
Rep: Reputation: Disabled
found two good ones, still looking -

the below monitors traffic on port 22 plus the username connected -
watch -n 0.5 lsof -n -i :22

this one monitors total rx/tx -
bwm-ng
 
Old 11-22-2017, 04:54 AM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 3,670
Blog Entries: 3

Rep: Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645Reputation: 1645
As far as which folders or files they are using, that can be set up by modifying what the SFTP subsystem logs if you are using OpenSSH server. Set a Match block for the group of users and force them into SFTP mode with modified logging:

Code:
Match Group watched
       ForceCommand internal-sftp -f LOCAL0 -l INFO
       Banner /etc/ssh/watched.banner.txt
Then configure your system log daemon to sort messages with log facility of LOCAL0 into their own file. You'll really want to do that because the logging at that level is quite noisy.

However, if you don't want the users roaming around the system when logged in, you can chroot them into a specific directory or hierarchy of directories.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptraf Detailed interface stats already monitoring eth1 mitter1989 Linux - Software 0 09-26-2013 04:44 PM
Displaying Network Usage Stats Woodsman Linux - Networking 2 07-15-2010 04:19 PM
Network Traffic Stats on virtual interface santhosh rao Linux - Newbie 2 02-14-2008 04:33 AM
How to reset network stats Technoslave Linux - Networking 4 03-09-2006 03:12 PM
Web/FTP/Shell user stats software? inspleak Linux - Software 1 04-03-2004 06:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 05:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration