Làm thế nào Risky Is It để chạy một máy chủ chủ bảo đảm đằng sau SSH?

Mục lục:

Làm thế nào Risky Is It để chạy một máy chủ chủ bảo đảm đằng sau SSH?
Làm thế nào Risky Is It để chạy một máy chủ chủ bảo đảm đằng sau SSH?

Video: Làm thế nào Risky Is It để chạy một máy chủ chủ bảo đảm đằng sau SSH?

Video: Làm thế nào Risky Is It để chạy một máy chủ chủ bảo đảm đằng sau SSH?
Video: Tính năng này trên iPad Pro M1 11 inch hữu dụng quá! - YouTube 2024, Tháng tư
Anonim
Khi bạn cần phải mở một cái gì đó trên mạng gia đình của bạn để internet lớn hơn, là một đường hầm SSH một cách an toàn, đủ để làm điều đó?
Khi bạn cần phải mở một cái gì đó trên mạng gia đình của bạn để internet lớn hơn, là một đường hầm SSH một cách an toàn, đủ để làm điều đó?

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Người đọc siêu người dùng Alfred M. muốn biết liệu anh ấy có đi đúng hướng với bảo mật kết nối không:

I have recently set up a small server with a low end computer running debian with the aim to use it as a personal git repository. I have enabled ssh and was quite surprised at the promptness at which it suffered from brute force attacks and the like. Then I read that this is quite common and learned about basic security measures to ward off these attacks (lots of questions and duplicates on serverfault deal with it, see for instance this one or this one).

But now I am wondering if all this is worth the effort. I decided to set up my own server mostly for fun: I could just rely on third party solutions such as those offered by gitbucket.org, bettercodes.org, etc. While part of the fun is about learning about Internet security, I have not enough time to dedicate to it to become an expert and be almost certain that I took the correct prevention measures.

In order to decide if I will continue to play with this toy project, I would like to know what I really risk in doing so. For instance, in what extent are the other computers connected to my network threaten as well? Some of these computer are used by people with even lesser knowledge than mine running Windows.

What is the probability that I get into real trouble if I follow basic guidelines such as strong password, disabled root access for ssh, non standard port for ssh and possibly disabling password login and using one of fail2ban, denyhosts or iptables rules?

Put another way, is there some big bad wolves I should fear or is it all mostly about shooing away script kiddies?

Alfred có nên dính vào các giải pháp của bên thứ ba, hay giải pháp DIY của anh có an toàn không?

Câu trả lời

Người đóng góp SuperUser TheFiddlerWins trấn an Alfred rằng nó khá an toàn:

IMO SSH is one of the safest things to have listen on the open internet. If you’re really concerned have it listen on a non-standard high end port. I’d still have a (device level) firewall between your box and the actual Internet and just use port forwarding for SSH but that’s a precaution against other services. SSH itself is pretty damn solid.

I have had people hit my home SSH server occasionally (open to Time Warner Cable). Never had an actual impact.

Một cộng tác viên khác, Stephane, nêu bật việc dễ dàng bảo vệ SSH như thế nào:

Setting up a public key authentication system with SSH is really trivial and takes about 5 minutes to setup.

If you force all SSH connection to use it, then it’ll make your system pretty much as resilient as you can hope to without investing a LOT into security infrastructure. Frankly, it’s so simple and effective (as long as you don’t have 200 accounts – then it gets messy) that not using it should be a public offense.

Cuối cùng, Craig Watson cung cấp một mẹo khác để giảm thiểu các nỗ lực xâm nhập:

I also run a personal git server that’s open to the world on SSH, and I also have the same brute-force issues as you, so I can sympathise with your situation.

TheFiddlerWins has already addresses the main security implications of having SSH open on a publicly-accessible IP, but best tool IMO in response to brute-force attempts is Fail2Ban – software that monitors your authentication log files, detects intrusion attempts and adds firewall rules to the machine’s local

iptables

bức tường lửa. Bạn có thể cấu hình cả hai lần thử trước một lệnh cấm và chiều dài của lệnh cấm (mặc định là 10 ngày).

Có cái gì để thêm vào lời giải thích? Âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Đề xuất: