logo © 1996 Phil Waclawski
Felitaur Site
Offerings
About Me
Crafts
Services
ftp files
Help Files
What's New?
Home Page
Other Links
Anatomy &
Physiology
Arthropods
Biology
Computers
Ferrets
Fun Links
Internet
Linux
S.C.A.
Win 95/NT
Comments or
Suggestions
webmaster@ felitaur.com
   
Portsentry Start/Stop Script
Lecture Overview Index | Linux SysAdmin Homepage

Portsentry is a program that helps you detect "Port scans" against your system. For this assignment you mustinstall portsentry version 2.01 or newer, from source code (no rpms)

Program requirements

  1. Must behave just like the start/stop scripts in /etc/rc.d/init.d
    (feel free to look at them for ideas).
  2. Using a "case" statement, your script should respond to the following via $1 (the command line argument)
    • start
    • stop
    • restart
    • status
    • and a default (shown as * in the case statement)
  3. You will need to find the PID of portsentry (pgrep -x)
  4. You must determine if the process is already running before starting it, (and if already running then let the user know) and if already stopped let them know that as well.
  5. restart needs to do all of the options for start and stop
  6. status must give the output:
    portsentry (pid #) is running.
    portsentry is NOT running.
  7. If they fail to type a valid option, or just give a bad option:
    Usage: portsentry {start|stop|status|restart}
  8. Finally, put the script into /etc/rc.d/init.d (set permissions and owner/group to the same as the other scripts in that directory
  9. Create a checkconfig comment line for runlevels 2345 where portsentry is set as S95 for a start and a K18 for a kill. (See the /etc/rc.d/init.d/sshd script for idea)
  10. Go into /etc/rc.d/rc3.d and do
    ln -s ../init.d/portsentryd S95portsentryd
    OR use chkconfig --level 3 portsentryd on
  11. Remember to Comment Out the /usr/local/psionic/portsentry2/portsentry line from the file /etc/rc.d/rc.local so you don't have portsentry started multiple times (but don't remove it, so I know you did it)