Digi CM Guía de usuario Pagina 156

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 202
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 155
Example Scripts
156 Chapter 17
User Storage Space
The Digi CM unit comes with 1 megabyte of user storage space. This storage
space can be used to store custom scripts. The location is /usr2. Custom
scripts such as simple commands, are simply dropped into /usr2. If a file
needs to be edited, copy the file into usr2/rc.usr, kill the process, then restart
the process from the new file. Scripts from the user storage may be created to
run during boot after the network is up. The following are some examples of
various ways to create a script stored in the user storage space.
Saving IP tables options permanently
Changing radius socket ports
Limiting root access to the console on Digi CM products
Sending a break
Example Scripts
Example Script: -Saving IP tables options permanently
Add the following command in the '/usr2/rc.user' script file just above "exit
0". Disabling Telnet is just shown as one example.
1. Create a new script file '/usr2/run.user' that includes the commands you
want.
iptables -A INPUT -p tcp --dport 23 -j DROP
2. Run the following command to make the script executable
chmod 755 /usr2/run.user
3. Add the following command in the '/usr2/rc.user' script, just above "exit 0"
ln -s /usr2/run.user /etc/rc.d/rc2.d/S60runuser
4. Reboot
reboot
Note: If you factory default the unit, the '/usr2/rc.user' script file is moved to '/usr2/
rc.user.old#' and the default rc.user file will be restored.
Example Script: -
Changing radius socket ports
The radius client obtains the radius socket ports to use via the
'/etc/services' file. The client only looks up the lines starting with 'radius'
and 'radacct'.
1. Modify the /etc/services file as follows. Change lines starting with 'radius'
and 'radacct' to the socket numbers you wish. For example:
radius 1645/tcp
radius 1645/ucp
radacct 1646/tcp
radacct 1646/ucp
system.cnf Basic network config information (IP, gateway, etc.)
timezone Time zone configuration
./.usracctl Directory containing user access control information
version Firmware version
File Name Description
Vista de pagina 155
1 2 ... 151 152 153 154 155 156 157 158 159 160 161 ... 201 202

Comentarios a estos manuales

Sin comentarios