SENA STS Series User Manual

Page 97

Advertising
background image

97

Step 3 Edit usr2/rc.user script as follows:

#!/bin/bash
#
# rc.user : Sample script file for running user programs at boot time
#

#PATH=/bin:/usr/bin:/sbin:/usr/sbin

# Add shell command to execute from here
# Add shell command to execute from here

cp -a /usr2/inetd.conf /etc/inetd.conf
ps -ef
while killall inetd 2>/dev/null;
do sleep 1;
ps -ef
done
/usr/sbin/inetd
ps -ef

exit 0

The user may now disable the telnet service every time the system boots up.

Example 2. Run iptables rule

Step 1 Modify 'usr2/rc.user script as follows:

#!/bin/bash
#
# rc.user : Sample script file for running user programs at boot time
#

#!/bin/bash
#
# rc.user : Sample script file for running user programs at boot time
#

#PATH=/bin:/usr/bin:/sbin:/usr/sbin

# Add shell command to execute from here

# if user wants to disable telnet service from all host
iptables -A INPUT -p tcp -s --dport 23 -j DROP

# if user wants to enable telnet service only from specific hosts(192.168.0.0 ~
192.168.0.255)
#iptables -A INPUT -p tcp -s ! 192.168.0.1/255.255.255.0 --dport 23 -j DROP

exit 0

The user may now disable the telnet service every time the system boots up.

If the user resets the STS Series to the factory defaults, /usr2/rc.user script file will be renamed to

/usr2/rc.user.old#

file, and the default rc.user file will be restored.

Advertising