Server Guides: Difference between revisions
formatting Tag: 2017 source edit |
formatting Tag: 2017 source edit |
||
Line 25: | Line 25: | ||
* '''Firewall''': Configure a firewall to control incoming and outgoing traffic. | * '''Firewall''': Configure a firewall to control incoming and outgoing traffic. | ||
* '''Regular Updates''': Ensure the server and all software are regularly updated. | * '''Regular Updates''': Ensure the server and all software are regularly updated. | ||
* '''Split Disks''': Separate < | * '''Split Disks''': Separate <pre>/tmp</pre> and <pre>/var</pre> partitions with <pre>noexec</pre> flag. | ||
* '''Log Monitoring''': Regularly monitor server logs for suspicious activities. | * '''Log Monitoring''': Regularly monitor server logs for suspicious activities. | ||
* '''Privilege Escalation Mitigation''': Use < | * '''Privilege Escalation Mitigation''': Use <pre>sysctl</pre> variables and kernel parameters to mitigate privilege escalation. | ||
* '''Audit''': Regularly audit the server using tools like < | * '''Audit''': Regularly audit the server using tools like <pre>rkhunter</pre> and <pre>debsecan</pre>. | ||
* '''Open Ports''': Only open necessary ports (e.g., 80, 443, 22). | * '''Open Ports''': Only open necessary ports (e.g., 80, 443, 22). | ||
Line 34: | Line 34: | ||
* '''Data Encryption''': Encrypt all data communication. | * '''Data Encryption''': Encrypt all data communication. | ||
** Use <pre>scp</pre>, <pre>ssh</pre>, <pre>rsync</pre>, or <pre>sftp</pre> for file transfer. | |||
** Consider VPNs like OpenVPN or tinc for secure connections. | |||
* '''Service Management''': | * '''Service Management''': | ||
** Avoid using insecure services like FTP, Telnet, and Rsh. | |||
** Minimize installed software to reduce vulnerability. | |||
* '''Kernel and Software Updates''': | * '''Kernel and Software Updates''': | ||
** Apply all security patches promptly. | |||
** Consider using tools like <pre>apticron</pre> for Debian-based systems. | |||
* '''Linux Security Extensions''': | * '''Linux Security Extensions''': | ||
** Enable SELinux or other security extensions to enforce limitations on applications. | |||
* '''User Accounts and Password Policies''': | * '''User Accounts and Password Policies''': | ||
** Enforce strong password policies. | |||
** Use tools like <pre>pam_cracklib</pre> to enforce password strength. | |||
** Set up password aging policies using <pre>chage</pre>. | |||
* '''Fail2ban''': | * '''Fail2ban''': | ||
** Install and configure Fail2ban to block IP addresses after failed login attempts. | |||
* '''Disable Unwanted Services''': | * '''Disable Unwanted Services''': | ||
** Disable unnecessary services and daemons. | |||
** Use <pre>systemctl</pre> to manage services on modern Linux distributions. | |||
* '''Network Security''': | * '''Network Security''': | ||
** Use <pre>iptables</pre> or <pre>firewalld</pre> to manage firewall rules. | |||
** Use tools like <pre>nmap</pre> to scan open ports. | |||
* '''File System Security''': | * '''File System Security''': | ||
** Separate critical file systems into different partitions with appropriate mount options (<pre>noexec</pre>, <pre>nodev</pre>, <pre>nosuid</pre>). | |||
* '''Regular Backups''': | * '''Regular Backups''': | ||
** Implement regular, encrypted backups to an offsite location. | |||
* '''Intrusion Detection Systems (IDS)''': | * '''Intrusion Detection Systems (IDS)''': | ||
** Use tools like AIDE and RKHunter for host-based intrusion detection. | |||
* '''Secure SSH Configuration''': | * '''Secure SSH Configuration''': | ||
** Configure SSH for maximum security (e.g., disabling root login, using SSH keys, configuring Fail2ban). | |||
[[Category:Self-hosting]] | [[Category:Self-hosting]] | ||
[[Category:Guides]] | [[Category:Guides]] | ||
[[Category:Server]] | [[Category:Server]] | ||
[[Category:Network]] | [[Category:Network]] |
Revision as of 03:31, 21 November 2024
Server Guides
Community Server Guides
- Matrix Server Guide
- Create SSH Keys
- Service - Storage - Nextcloud
- Authentik Installation
- Setting Up Cryptpad Server
- Proxmox
Best Practices to Secure Servers in 2024
Source:
- Best practice to secure servers in 2024
- Madaidans Insecurities Linux Hardening Guide
- Cyberciti Linux Security Tips
General Security Practices
- No Root Login: Disable root login to enhance security.
- SSH Keys with Password: Use SSH keys with a passphrase and disable password login.
- VPN Access: Require VPN access to reach the SSH server.
- Firmware and Auto Updates: Enable automatic updates for both firmware and software.
- Firewall: Configure a firewall to control incoming and outgoing traffic.
- Regular Updates: Ensure the server and all software are regularly updated.
- Split Disks: Separate
/tmp
and/var
partitions withnoexec
flag. - Log Monitoring: Regularly monitor server logs for suspicious activities.
- Privilege Escalation Mitigation: Use
sysctl
variables and kernel parameters to mitigate privilege escalation. - Audit: Regularly audit the server using tools like
rkhunter
anddebsecan
. - Open Ports: Only open necessary ports (e.g., 80, 443, 22).
Detailed Security Measures
- Data Encryption: Encrypt all data communication.
- Use
scp
,ssh
,rsync
, orsftp
for file transfer. - Consider VPNs like OpenVPN or tinc for secure connections.
- Use
- Service Management:
- Avoid using insecure services like FTP, Telnet, and Rsh.
- Minimize installed software to reduce vulnerability.
- Kernel and Software Updates:
- Apply all security patches promptly.
- Consider using tools like
apticron
for Debian-based systems.
- Linux Security Extensions:
- Enable SELinux or other security extensions to enforce limitations on applications.
- User Accounts and Password Policies:
- Enforce strong password policies.
- Use tools like
pam_cracklib
to enforce password strength. - Set up password aging policies using
chage
.
- Fail2ban:
- Install and configure Fail2ban to block IP addresses after failed login attempts.
- Disable Unwanted Services:
- Disable unnecessary services and daemons.
- Use
systemctl
to manage services on modern Linux distributions.
- Network Security:
- Use
iptables
orfirewalld
to manage firewall rules. - Use tools like
nmap
to scan open ports.
- Use
- File System Security:
- Separate critical file systems into different partitions with appropriate mount options (
noexec
,nodev
,nosuid
).
- Separate critical file systems into different partitions with appropriate mount options (
- Regular Backups:
- Implement regular, encrypted backups to an offsite location.
- Intrusion Detection Systems (IDS):
- Use tools like AIDE and RKHunter for host-based intrusion detection.
- Secure SSH Configuration:
- Configure SSH for maximum security (e.g., disabling root login, using SSH keys, configuring Fail2ban).