B
B
bmgg2021-06-16 09:54:57
linux
bmgg, 2021-06-16 09:54:57

Can a Linux server be hacked?

I plan to raise a web server containing valuable data on nginx + django, debian OS.
To ensure security:
- a firewall is installed that blocks everything except the ssh and nginx port
- fail2ban is installed and ssh access by key is configured
- regular system updates

What is the probability of server hacking and how can I improve its security?

Answer the question

In order to leave comments, you need to log in

10 answer(s)
A
Alexey Dmitriev, 2021-06-16
@SignFinder

Yes, they can be easily hacked. For one simple reason - you are not a professional in securing linux servers, since you asked your question here. So there's a good chance you'll miss something.

V
Vladimir Korotenko, 2021-06-16
@firedragon

Either they get hacked or not
Security is a process Linux itself is pretty well protected
But your Django application may contain errors look towards OWASP to avoid the most obvious

R
Ronald McDonald, 2021-06-16
@Zoominger

In theory, they can, especially considering how many holes and zeroes there are in Linux.
But your methods completely reduce this probability to zero.
True, I would not advise the ancient Debian with rotten packages, but some CentOS or Ubuntu.

I
index0h, 2021-06-16
@index0h

Regarding ssh and nginx: it's better to open nginx on a public ip, and ssh on a private one.

U
Uncle Seryozha, 2021-06-16
@Protos

Think more about the architecture, you need to ask the question of how to reduce the likelihood of access to sensitive data before the attack is detected and blocked by you.
You also need to look in the direction of architecture: the web server is in the DMZ, the Jango application is in another segment, the base is in another. Access from the Internet only to the DMZ server on the user port (tcp443), the admin panel is available from inside the network from another segment where your PC is.
60c9c5fad39dd711084013.jpeg

D
Drno, 2021-06-16
@Drno

Allow SSH in the firewall only from certain IPs. (for example, from your external, home) Then they definitely won’t climb on it. Well, about the security of the web server, think for yourself, it depends on the application

A
acwartz, 2021-06-16
@acwartz

And how can you improve its security?

you can not do all this on your own, but hire specially trained people or even a company that will give you ftp / ssh and you will not have a headache about any of this, well, except for paying for services.

F
Fenrir89, 2021-06-16
@Fenrir89

ssh by key, nginx prohibits uploading files, only reading to the directory with php (python)

A
Alexander Falaleev, 2021-06-16
@suffix_ixbt

All the advice is correct, but the main thing is to read the news of specialized sites every day.
A 0-day vulnerability in Exim led to hundreds of thousands of Linux servers being hacked around the world.

N
none7, 2021-06-17
@none7

Django vulnerabilities are pouring in from a cornucopia. So, if they want to hack, they will hack. It should be treated as untrusted code as JS by default in browsers. If this valuable data is issued by this engine, then you can forget about their secrecy. You can only protect it by closing the Web server from the outside, and allow access only through a VPN, for example, by forwarding ports through ssh. Then only customers will be the weak point. However, in these times of huge botnets, this is not at all a guarantee of protection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question