This section is intended for those who are familiar with Linux based systems. If you are just learning Linux, it is recommended that you skip this section for now and come back to it later when you feel a bit more comfortable at the command line.
After using the Network Security Toolkit for awhile, you'll find yourself wishing their was a means to simplify the initialization process. If you have a thumb drive, flash drive, floppy disk, a hard disk, or even a web server, you are in luck - the lnstcustom command can simplify your setup.
It should be noted, that this automation is not completely hands free. You will need to invoke lnstcustom each time you boot, but you won't have to type much else.
You need to be familiar with writing bash (or sh) scripts prior to doing much automating. However, the Network Security Toolkit makes an excellent environment to hone those scripting skills.
This section is going to walk you through the creation
of a simple setup.sh
script that can be
used by lnstcustom to automate the
following:
Changing the default password.
Starting X
.
After following these steps, you should be able to boot the Network Security Toolkit, log in, plug in your thumb drive, and type the following command:
[root@probe root]#
lnstcustom test
After typing the above, you should see that the password is being changed, and after what seems a long time, the X desktop should come up (you will be be presented with the X configuration utility the first time invoked, but it will remember your settings for future invocations).
For this example, I'm going to borrow my wife's Creative Muvo Nomad MP3 player which also acts as a standard thumb drive (do me a favor and don't mention this to my wife). After plugging the MP3 player into a USB port, the following commands are entered:
[root@probe root]#
mount -t vfat /dev/sda1 /mnt/memstick
![]()
[root@probe root]#
mkdir /mnt/nst/test
![]()
[root@probe root]#
jed /mnt/nst/test/setup.sh
Here are the commands we will type into the
setup.sh
script.
#!/bin/bash printf "letmein\nletmein\n" | nstpasswdif [ -f "$NSTHOME/XF86Config" ]; then
cp "$NSTHOME/XF86Config" "/etc/X11" /etc/rc.d/init.d/xfs start startx else
setup_x if [ -f "/etc/X11/XF86Config" ]; then cp "/etc/X11/XF86Config" "$NSTHOME/" startx fi fi
The above assumes that you will be using the
X configuration on the same
system (or another system with identical hardware). NEVER
use a X configuration created for
one system on a different system (you may damage
something). If you plan on using the same thumb drive on
different systems, you should create a different directory
for each system, or change the setup.sh
script such that it ALWAYS invokes
setup_x before invoking
startx.
After saving the file (Control-X Control-S) and leaving the editor (Ctonrol-X Control-C), we will find ourselves back at the command prompt ready to try out the customization.
[root@probe root]#
umount /mnt/memstick
![]()
[root@probe root]#
lnstcustom test sda1 vfat
... Lots of output as passwords are changed and X starts ...
This should be enough information to get you started in
creating your own customization scripts. You can do a lot if
you use your imagination and just keep adding to your
setup.sh
script.