Securing-Optimizing-RH-Linux-1_2_466
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
466
1.2 Display the number of time you Web pages has been acceded:
To display quickly the number of times your web page has been accessed use this command:
[root@deep /]# grep "GET / HTTP" /var/log/httpd/access_log | wc -l
467
1.3 Shut down most services altogether
As root, you can shut down most services altogether with the following command:
[root@deep /]# killall httpd smbd nmbd slapd named
The above command will shut down the Apache server, Samba services, LDAP server, and DNS
server respectively.
1.4 Want a clock on the top of your terminal for all user?
Edit the profile file (vi /etc/profile) and add the following line:
PROMPT_COMMAND='echo -ne
"\0337\033[2;999r\033[1;1H\033[00;44m\033[K"`date`"\033[00m\0338"'
The result will look like:
1.5 Do you have "lsof" installed in your server?
If not, install it and execute "lsof -i". This should list which ports you have open on your machine.
The lsof program is a great tool, it will tell you which processes are listening on a given port.
[root@deep /]# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
Inetd
344 root 4u IPv4 327
TCP
*:ssh (LISTEN)
sendmail
389 root 4u IPv4 387
TCP
*:smtp (LISTEN)
smbd
450 root 5u IPv4 452
TCP
deep.openarch.com:netbios -ssn (LISTEN)
nmbd
461 root 5u IPv4 463
UDP
*:netbios -ns
nmbd
461 root 6u IPv4 465
UDP
*:netbios -dgm