Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 758  / 1 Year ago, fri, november 25, 2022, 11:35:34

I have seen tutorials for reporting suspicious logins (from the wrong IP) using /etc/ssh/sshrc.
I would like to take it to the next level and kick out those users (close the ssh session immediately).



I have tried exit (doesn't work) and logout (rejected: /etc/ssh/sshrc: line 16: logout: not login shell: use "exit").



How can I do that?


More From » ssh

 Answers
0

Easiest way is to kill session.
First list session



netstat -tanp


The PID to kill is in the right hand column.



sudo kill -9 PID

[#25539] Sunday, November 27, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Wed, Aug 4, 21, 03:15, 3 Years ago
Sat, Apr 16, 22, 17:34, 2 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;