Though many of us have converted our Operating Systems, bbs software, echomail tossers, and mailers to new ones many times, changing one's setup to run under Linux can be perhaps more challenging than anything else ever experienced <smile>.
Hopefully this article will be of some help if you have just switched
to Linux, or if you are about to do so. I'll show you some comparisons
between DOS and Linux so that you can see that Linux isn't as foreign as
it might at first seem, and then I'll provide some scripts that I've written
to perform various functions on my bbs system. Lastly, I'll also include
a few notes regarding some things you should _make sure_ do when you install
linux. Security under Linux is a very large topic however, so I will cover
that in more detail in a later article.
Tip: It would probably be a good idea to type 'man command', or 'info command', or 'command --help' without the quotes to see all the options of these Linux commands.
Some Linux examples:
ls -d .* Show only "." directories. (these are often configuration files, etc. for various programs). The -d indicates that only the directory name should be shown, not the contents.ls -ltr Sort by date, reverse order.ls --color=auto Turn on color for file types in directory list ls -1 -1 (one) shows file names in column list with no other info
Example of ls -1:
[janis@filegate]$ ls -1
Some Linux examples:
mv /janis/*.txt /afiles
move *.txt to directory /afiles.
you can then use md instead of mkdir.
An example of find:
[bbs@filegate /home/bbs]$ find /home/ftp/pub -daystart -ctime 00
Some examples of Linux commands:
The mount command with no parameters specified shows you the devices currently mounted.
[bbs@filegate ~]$ mount
Getting Help with Commands:
Editing and Printing
Backup, Compression, and Archival
Archivers which you may have used under DOS are available:
zip unzip lha unarj pkzip251 arc rar
Viewing multiple Archives with zip and rar:
As you probably know, under DOS, unzip -v filename.zip,
will list the contents of one archive.
unzip -v "*.zip"
[bbs@filegate bbbs]$ unzip -v "*.zip"
Tar and gzip are used commonly on Linux. Often you'll see archives with tgz extensions, .gz, or no extension at all.
Tar doesn't compress the data, that's why gzip, a compressor, is used with it.
You can use the file command to see how the file is archived/stored
if there is no extension or if you are just curious:
[bbs@filegate bbbs]$ file ZPMF025D.TGZ
gzip -d ZPMF025D.TGZ
This results in the file ZPMF025.tar
To list the contents of the tar file, type
tar tf filename.tar
To extract the tar, type
tar xf filename.tar
There are options to "keep old files" with both gzip and tar which you may also want to include on the command line. The default action is to remove the original tar. See
tar --help and
This shortcut extracts both the tar and gzip files in one command:
tar xvzf filename.tar.gz
The "z" flag says "un-gzip before un-tarring". The same
flag works in reverse when tarring.
Some BASH Scripts
One of the neatest things about *nix systems is that any file can be
made executible by simply changing the attributes of the file.
Here are some scripts I've written for my bbs - none of these contain
any startling ideas, and I don't doubt a number of them could
info bash will show you the system's man pages for these scripting keywords.
To use these scripts, save them to a file and then make them executible
with 'chmod a+x filename' without the quotes.
mylist="`ls -1 *.bad`"
for file in $mylist
f=`basename $file .bad`.tic mv $file $fdone
dir -1 -I*.tic -I*.sh -Iticlist -Iarchives >> archives
f=`basename $tics .tic` zip -jm0 $f.zic $file $ticsfi
mv *.zic /home/bbs/binkd/barry
chown bbs.bbs /home/bbbs/binkd/barry/*
Next, mvfile2in.sh uses another file you must create named dirlist.
You can create this file with the command: dir /home/* -1 > dirlist
echo "$f bsy-flag exists"
get_desc can be used to import file descriptions to a files.bbs or descript.ion type file list.
tr '\n\r' ' ' <FILE_ID.DIZ >tmp.ff echo $f `cat tmp.ff` >> descript.txt rm -f FILE_ID.DIZ tmp.fffi
Some Install Concerns for the SysOp Installing Linux
system <grin>. Issuing a command like rm -r from the / directory as user root will surely go through the entire directory tree
and do just what you told it to do (rm -r deletes recursively... <ouch>. )
Of course there will be times when you must log on as root to do things such as install your apache web server, configure your ppp connection, etc., but that is really the only time you should log in as root. Likewise, you should never log in as root in XWindows as user root, except as above. XWindows can destroy your data if you are user root and are playing with commands.
Use the adduser command to create other users on your system
which you can use on a daily basis.
where username is the name you have selected, 8 characters or less.
Linux will let you use longer names for the users, but will truncate them.
The adduser command adds the user to the passwd file in /etc/passwd, and
unless you specify otherwise, creates a directory off /home which is that
user's 'home' directory. These limited-access users can only harm the files
they own in their
The passwd command prompts you for this users' password, 8 characters
or less since again it will be truncated if it's over 8 characters. The
password you choose should be a combination of upper and lower case
alpha characters and numbers.
Tip: Try to make the password something that means something to you, then use the letters of the words to make up your password.For Example:
I Love Chocolate cake I'll take one thanks = ILccIt1t
1. After installing linux, the very first thing you should do is pull up your favorite text editor, and edit the inetd.conf file which lives in /etc (/etc/inetd.conf). Comment out every single line in that file except for the one that refers to ftp if you figure to use ftp. If you think this sounds drastic, well, it is. And it's necessary. If you leave the file as is, you are leaving an incredible number of ports and services open to trouble-makers who will (most likely) be port-scanning your system over and over again looking for weak points. You probably won't need any of the services you are commenting out - and some of them, like rlogin, are incredibly famous for having holes where hackers can gain access to your system.
2. Use ssh, (Secure Shell) instead of telnet. Comment telnet out from inetd.conf. If you think are going to need telnet so that you can telnet into your system remotely, DON'T. Use Secure Shell instead. If Secure Shell isn't already on your system, go to http://rpmfind.net/ and download and install it.
3. If your distribution of linux installs wu-ftpd, install
a different ftp daemon, such as Bero-ftpd, or Proftpd. Why
4. All of the above is good, but don't rest easy yet.. Another thing you must do is contantly stay aware of upgrades to the software you use. If, for example, a new version of bero-ftpd is released, install it. Upgrades under linux are not always done to make the software prettier or sexy <grin>. The site that maintains the software you use will always post what type of upgrade the software is and whether it is a security upgrade.
The following articles may be helpful - they contain some of the same information as above, but some additional information as well.
Copyright 2003 by Janis Kracht