ginksman
ginksman

Reputation: 43

how to find how long my ssh connection is being active

Doing some platform automation and planning to devise some logic around how long a user ssh session is being active. is there a way to find?

Upvotes: 1

Views: 2185

Answers (1)

kimdasuncion12
kimdasuncion12

Reputation: 349

Have you checked the output of "last", maybe it would be sufficient?

server ~ $ last
root     pts/0        10.31.1.162      Fri Dec 11 10:35   still logged in
root     pts/0        10.31.1.162      Thu Dec 10 11:12 - 11:22  (00:09)
root     pts/0        10.31.1.162      Thu Dec 10 09:19 - 11:09  (01:50)

Upvotes: 1

Related Questions