Page 1 of 1

Monitoring whos connected to my pi

Posted: Wed Feb 08, 2017 2:22 pm
by Neddie
Hi to all.
Is it possible to tell who is connected (via Ethernet) to my pi at any time.
I'm looking for something similar to Windows "Computer Management"
where you can see who has what files open ,shares etc.
I'm sure it's possible. I've tried things like nmap , but that didn't give me what I want.
I may have been using it incorrectly though.Cheers
Neddie

Re: Monitoring whos connected to my pi

Posted: Wed Feb 08, 2017 2:50 pm
by topguy
You'll have to define what services you want to monitor the usage of.
Filesharing ( Samba ) is just one such service. SSH which allows users to log in to a shell is another service. There are probably another couple of hundreds different services you could install on your Pi if you wanted. Linux is not tied together the way Windows is, so there is no common tool to monitor all services that allow remote connectivity.

https://www.cyberciti.biz/faq/how-do-i- ... ba-server/

Re: Monitoring whos connected to my pi

Posted: Thu Feb 09, 2017 11:48 am
by ghans
The traditional commands "who" , "w" , "last" and "ps" don't count ?

Also interesting : "lsof" , "fuser" .

ghans

Re: Monitoring whos connected to my pi

Posted: Thu Feb 09, 2017 6:20 pm
by Neddie
Lets say monitoring SSH.
who , w , ps seem to work , but being new to Linux I need to figure them out still :0)
I don't know what half the info means :0(
Thanks
Neddie

Re: Monitoring whos connected to my pi

Posted: Thu Feb 09, 2017 6:41 pm
by Neddie
I think who and w will work for me , thanks.
Neddie

Re: Monitoring whos connected to my pi

Posted: Thu Feb 09, 2017 7:31 pm
by mfa298
Neddie wrote:I think who and w will work for me , thanks.
Neddie
The other tool that's useful for shell logins (ssh, using the terminal) is "last" which will show who has logged in and when.

Re: Monitoring whos connected to my pi

Posted: Thu Feb 09, 2017 8:56 pm
by DougieLawson
pi@viking ~ $ grep -i 'session' /var/log/syslog
Feb 9 18:33:39 viking systemd[1]: Starting Session c13 of user root.
Feb 9 18:33:39 viking systemd[1]: Started Session c13 of user root.
Feb 9 18:40:55 viking systemd[24158]: Starting Exit the Session...
Feb 9 19:27:43 viking systemd[1]: Starting Session c14 of user pi.
Feb 9 19:27:43 viking systemd[1]: Started Session c14 of user pi.
Feb 9 19:28:28 viking systemd[24681]: Starting Exit the Session...
Feb 9 19:35:42 viking systemd[1]: Starting Session c15 of user pi.
Feb 9 19:35:42 viking systemd[1]: Started Session c15 of user pi.
pi@viking ~ $