Setting up the turnkey system using either of the next two methods provides increased Telnet functionality, but does not maintain compatibility with other D3 platforms and releases. The following methods are the recommended methods for setting up a turnkey system.
Configuring Telnet in this manner sends the user directly to the D3 logon prompt. It does not display the Telnet login prompt.
Create a copy of the /etc/xinetd.d/telnet file. For example:
cp /etc/xinetd.d/telnet /etc |
Create an executable script to execute D3 and place the script in the /usr/bin directory.
This is a sample script. We will name it tnet for our example:
#!/bin/bash exec /usr/bin/d3 -dcdon |
Open the Telnet configuration file.
/etc/xinetd.d/telnet |
Add a reference to the script you created in the this configuration file.
NOTE |
This instructs the Telnet configuration file to run the D3 program when connection is established and instructs the D3 logon to open immediately when a Telnet connection is requested. |
For example, add this line under the server option line.
server_args = -L /usr/bin/tnet |
Before the Telnet file is modified to add the script under the server_args option, the file looks like this:
{ flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID disable = no } |
After the Telnet file is modified to add the script under the server_args option, the file looks like this:
{ flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd server_args = -L /usr/bin/tnet log_on_failure += USERID disable = no } |
Restart the xinetd daemon (so the modification you performed in step three will take effect) by typing this script:
/etc/rc.d/init.d/xinetd restart |
Configuring Telnet in this manner bypasses a UNIX log in, providing a direct login to a D3 PIB.
Create a permanent directory to hold both the following script and the symbolic links to that script.
For this example the directory name is d3net. It is placed in the /usr/bin directory. The full path is /usr/bin/d3net.
Set the permissions to read and execute (rx) for all users.
This example creates the directory named d3net in the /usr/bin directory, and changes the permissions to read and execute for all users.
mkdir /usr/bin/d3net chmod a+rx /usr/bin/d3net |
Select a range of port numbers not currently in use on your system, and large enough for all your D3 PIBs.
This example uses PIBs 1 through 20. The port range is 16001 to 16020.
Create a script to calculate the PIB from the port number and place it in the directory created in step 1.
The script executes d3 passing the result of the subtraction as the only argument on the command line. The following sample script does this.
For this example, assume the script name is netcon and the directory name is /usr/bin/d3net, the full path is /usr/bin/d3net/netcon. Enter:
#!/bin/bash PIB=$(basename $0) PIB=$(($PIB – 16000)) exec /usr/bin/d3 $PIB |
Change the permissions to read and execute for all users.
chmod a+rx /usr/bin/d3net/netcon |
Create a symbolic link (ln –s) for each port in the range, using the port number as the name of the link, and the script you created as the source.
Remember, in our example the script name is netcon, and the port range is 16001 to 16020.
ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16001 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16002 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16003 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16018 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16019 ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16020 |
When all the links are created, a long listing (ls –l) of the directory looks like:
total 50 lrwxrwxrwx 1 root root 6 Jan 14 18:47 16001 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 root root 6 Jan 14 18:47 16002 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 root root 6 Jan 14 18:47 16003 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 root root 6 Jan 14 18:47 16018 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 root root 6 Jan 14 18:47 16019 -> /usr/bin/d3net/netcon lrwxrwxrwx 1 root root 6 Jan 14 18:47 16020 -> /usr/bin/d3net/netcon -rwxr-xr-x 1 root root 72 Aug 7 14:03 netcon |
For every file that is put into the /usr/bin/d3net directory, a corresponding file must be created in the /etc/xinetd.d directory. This assures proper operation of the Telnet feature.
Create a file in the /etc/xinetd.d directory, like the one shown below, for each of the ports that will be used for log in.
For Example:
service d316001 { type = UNLISTED socket_type = stream protocol = tcp wait = yes server = /usr/sbin/in.telnetd server_args = -L /usr/bin/d3net/16001 port = 16001 } |
In the example above, note that the:
Name of this file is d316001 (d3+ port number). The name of each file in your range of ports will be d3 + the next port number in the sequence of numbers chosen for your range of ports. For instance, the next file name for this example will be d316002.
service d316001 line of our example uses the same name as the file name.
server_args line must end with the same number used in the file name and the service d316001 line.
port line of our example must reflect the same number as the service d3, and the server_args lines; note that in our example the port number is also 16001.
After all of the files in your range of ports have been created, issue this command to restart the deamon.
/etc/rc.d/init.d/xinetd restart |
See Also