Hardening Linux Server
Some Steps
Installation of Linux OS
Install the OS with minimal installation, then proceed to install only the required packages.
Removing the unwanted packages in os like gnome, kde,games,Openoffice not needed for server configuration.
Securing the Bootloader
Grub should be configured with password
Restrict access to Server
/etc/hosts.allow and /etc/hosts.deny
should be configured
Modify /etc/hosts.allow
Suggested format:
# Approved IP addresses
ALL: 192.168.0.1
ALL: 192.168.5.2
# CSV uploader machine
proftpd: 10.0.0.5
# pop3 from anywhere
ipop3: ALL
Modify /etc/hosts.deny
ALL:ALL EXCEPT localhost:DENY
Securing SSH
vi /etc/ssh/ssh_config change the following
protocol 2,1 to protocol 2
PermitRootLogin yes to PermitRootLogin no
Restart SSHD: /etc/rc.d/init.d/sshd restart
Setting SSH Banner for the making user to consent to the terms & conditions
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#*****************************************************************************#
# This computer system is for authorized users only. All activity is logged #
#*****************************************************************************#
Set the ssh banner by creating a file /etc/ssh/sshd-banner , and add/edit the sshd configuration in the file /etc/sshd/sshd_config as follows Banner /etc/ssh/sshd-banner save and restart the sshd service.
Disable Telnet
vi /etc/xinetd.d/telnet change disable = no to disable = yes
Disable root login for FTP Server
vsftpd by default wont allow root, proftpd & others need to be configured explicitly
Installation of Linux OS
Install the OS with minimal installation, then proceed to install only the required packages.
Removing the unwanted packages in os like gnome, kde,games,Openoffice not needed for server configuration.
Securing the Bootloader
Grub should be configured with password
Restrict access to Server
/etc/hosts.allow and /etc/hosts.deny
should be configured
Modify /etc/hosts.allow
Suggested format:
# Approved IP addresses
ALL: 192.168.0.1
ALL: 192.168.5.2
# CSV uploader machine
proftpd: 10.0.0.5
# pop3 from anywhere
ipop3: ALL
Modify /etc/hosts.deny
ALL:ALL EXCEPT localhost:DENY
Securing SSH
vi /etc/ssh/ssh_config change the following
protocol 2,1 to protocol 2
PermitRootLogin yes to PermitRootLogin no
Restart SSHD: /etc/rc.d/init.d/sshd restart
Setting SSH Banner for the making user to consent to the terms & conditions
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#*****************************************************************************#
# This computer system is for authorized users only. All activity is logged #
#*****************************************************************************#
Set the ssh banner by creating a file /etc/ssh/sshd-banner , and add/edit the sshd configuration in the file /etc/sshd/sshd_config as follows Banner /etc/ssh/sshd-banner save and restart the sshd service.
Disable Telnet
vi /etc/xinetd.d/telnet change disable = no to disable = yes
Disable root login for FTP Server
vsftpd by default wont allow root, proftpd & others need to be configured explicitly
Comments