I checked this answer and this option - it is good, but it requires sudo
rights.
I need that this command may be performed by any user, for this reason I am using next command
ps -ef | grep sshd: | grep -v grep
and getting following result:
[owner@localhost ~]$ ps -ef | grep sshd: | grep -v grep
root 3175 2217 0 15:09 ? 00:00:00 sshd: [accepted] //Here just oppened putyy from windows pc
sshd 3177 3175 0 15:09 ? 00:00:00 sshd: [net] //same as above
root 8062 2217 0 12:34 ? 00:00:00 sshd: root@pts/8
root 24241 2217 0 13:37 ? 00:00:00 sshd: root@pts/10
root 31515 2217 0 14:38 ? 00:00:00 sshd: owner [priv] //non-root user connected
503 31567 31515 0 14:38 ? 00:00:00 sshd: owner@pts/12 //the same as above line
How to filter out only real connections?
What are the meaning of keywords "priv
", "accepted
", "net
"?
P.S. I need to do it without sudo
rights.