can anyone tell me what do I have to do to protect my server? In windows, we install anti virus and firewall immediately after operating system is installed. What about linux server?

Do we use firewall? And how do i close all the ports? and leave some open for programs? Can anyone please explain a little bit about these things? thanks

Dani AI

Generated

A compact, practical checklist that fills gaps in the replies from , , and . Prioritize layers: reduce running services, control network access, lock down remote access, keep software patched, and monitor logs.

Start by inventorying what actually listens and what is enabled:

sudo ss -tunlp              # show listening sockets and PIDs
sudo systemctl list-unit-files --state=enabled

See the ss and systemctl manuals for details (ss(8), systemctl).

Use the distro firewall to permit only required ports (zones/services) and stop services you do not need. Example with firewalld:

sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --remove-service=ftp
sudo firewall-cmd --reload

Read the firewalld docs for zone-based rules and rich rules (firewalld documentation). nftables is the modern packet filter if you prefer writing rules directly (nftables wiki).

Harden SSH: require keys, disable password auth and root login in /etc/ssh/sshd_config (PasswordAuthentication no, PermitRootLogin no), and use strong ciphers—see the OpenSSH manual (OpenSSH manual). Mitigate brute-force attacks with fail2ban or rate-limiting rules (Fail2Ban).

Keep the kernel and packages updated, enable SELinux in enforcing mode for Mandatory Access Control (SELinux project), and centralize logs/alerts. For production with long-term support needs consider a vendor-supported release; Fedora Server is good for current stacks (Get Fedora Server).

These steps are the practical actions behind the earlier opinions: inventory, remove/stop unused services, enforce access control, and monitor. Follow the linked docs for configuration examples and safe rollback procedures.

Recommended Answers

All 3 Replies

I think Linux better than windows.
I don't use windows.
You don't have to close all the ports.
I feel Linux is very security.

If you very care the security of your server, you could install some anti-virus software.
The linux core inludes firewall itself.So you don't need to install another firewall, and all you need to do is just configure your firewall.

You don't have to close all the ports.

are you an idiot?
of course you have to close the ports, in case you havent noticed the servers of banks etc.. run linux and unix and they are prime targets for hacks

secondly, why fedora? fedora isnt good for servers, it has short release cycle and is very buggy and bloated. Its essentially the beta version of Red Hat which is a server-grade OS.

fedora includes SeLinux and a firewall which should be on by default. Do you have a GUI or not? then i can tell you how to configure it.

commented: Moderator talking down to a normal user adding valid input +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.