Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 759  / 3 Years ago, sat, may 29, 2021, 12:27:50

I see there are continuous attempts to login into my computer via ssh using usernames, like joan florin root from 60.169.22.118,



-how can I forbid ssh access and only allow it to users with specific key.



-or for now how can I block traffic from that specific ip.



-or any other ways of securing more the connection to my home network.



I do have vpn, but the problem is, the service goes down every now and then, so ssh is the only sure, or constant service that can tell me when my server is up and running at home.


More From » 12.04

 Answers
7

Edit your /etc/ssh/sshd_config



Add a line like



AllowUsers kmassada


Now only that user will be allowed to ssh in. Also, I run ssh on an unusual port, not 22, and this bumps off most would-be intruders.



And/or



PasswordAuthentication no


Which means you'll have to have an authorized key to connect. I'd suggest



PermitRootLogin no


too. See man sshd_config for these details.


[#35766] Sunday, May 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brailloni

Total Points: 122
Total Questions: 108
Total Answers: 108

Location: North Korea
Member since Tue, Apr 4, 2023
1 Year ago
brailloni questions
Tue, Jun 21, 22, 21:51, 2 Years ago
Thu, Jul 29, 21, 05:25, 3 Years ago
Sat, Apr 2, 22, 17:32, 2 Years ago
Mon, Oct 31, 22, 21:39, 2 Years ago
;