The aim of this project is to produce a unix server which provides SSH, FTP, SMTP, POP, IMAP, NTP, HTTP (Apache, PERL and PHP), SQL (MySQL), SMB file and print sharing (Samba and CUPS), and email filtering (SpamAssassin) service. An all-in-one drop-in replacement for Windows and Netware servers, basically, with some extra features. I know that unix is more reliable and secure, and is more powerful, than any version of Windows, and I wish to pass these benefits onto my customers.
Note, this server will be on a NATted LAN inside the corporate firewall, which is a separate device, and doubles as a router, DNS server, and ADSL uplink. DHCP is not used.
Looking for a unix desktop instead of a server platform? Check out PC-BSD - This is FreeBSD + KDE (a popular GUI), with a sexy installer, some smart scripts and a bunch of services preinstalled and preconfigured. It doesn't try to be a server - this is a system designed to do the same job as Windows XP. It's very slick indeed.
The first step is to settle upon which unix to use. I poked around on the net, and I read some of the documentation. Factors influencing my decision included popularity, lineage, and hardware support. In the end, FreeBSD was the clear winner; not only modern and well-supported, but also with a distinguished history, and reference sites including yahoo.com, apache.org, cdrom.com and even (once upon a time) hotmail.com. Sold... Linux? Oh yes - that's the unix that uses BSD components, GNU components, Linus components.. I've heard of it.
I then needed to select a distribution - there's NetBSD, OpenBSD and FreeBSD. NetBSD is optimised for portability... I don't need that. OpenBSD's main advantage seems to be security - I didn't feel the need to encrypt my swapspace... so I opted for the high-performance FreeBSD instead. See also a comparison of BSD operating systems and/or Distrowatch for more information.
Hardware-wise, BSD runs on pretty well anything, including the 333MHz AMD K6 in the test server, with 128Mb of RAM and 4Gb of disk. BSD can run with less resources than these - but I doubt it's recommended. A BIOS with support for LBA and bootable CD-ROMs is also suggested. While BSD can run on ancient hardware, the limitations this imposes on the flexibility of the system may be excessive. Certainly, for production servers I hope to use the latest and fastest hardware. Note that BSD, being a community-supported OS, does not immediately support new devices; nor do manufacturers usually ship BSD drivers. Ensure that drivers are available, working and stable before committing to a specific device.
Software-wise, aside from the operating system I also had to decide which servers and applications to deploy. I stuck with the tools I knew.
Note: once you've settled on a distribution, you might like to stick with the particular version of the distribution you download, at least for a while. This will allow you to compare and contrast between your builds (you will no doubt do several). If you always use the latest version of the distribution, you will be introducing inconsistencies between your builds, this will be confusing if you are still learning how the system works. So, select your download very carefully. As always, avoid ".0" releases, you want a version number x.1 or higher.
Next, I had to get the FreeBSD CDs. I downloaded the full distribution as an ISO from a mirror over my ADSL connection. It took around 8 hours, at 512Kbps, for the two CDs. After verifying the MD5 hash for each ISO, I then burned the ISOs onto CDs. If you're not sure how to burn an ISO from a mirror onto a CD, or, indeed, verify the MD5 hashes, this is your cue to open a new browser window and zoom over to your favourite search engine. I did try using BitTorrent to get the ISOs, but it was going to take twice as long, plus saturate my outbound, so I aborted BitTorrent and went for good old FTP.
install
My machine had bootable CD-ROM support, so I put in disk 1 and booted off it. However, if bootable CD-ROM support is not an option, the first task is to make the FreeBSD installation floppies. Previous distributions included MAKEFLP.BAT and/or FDIMAGE.EXE to make the floppies, however the 6.0-RELEASE distribution does not. To set up 6.0 on a machine without a bootable CD-ROM, I used the FDIMAGE.EXE from my old FreeBSD 4.11 CD (it's the same binary) to execute this command from the \floppies directory on the CD: fdimage -v boot.flp a: (note: in release 6.1, FDIMAGE.EXE is back in the \tools directory on the CD). I then also created the two kernel disks, I made sure I had the boot disk in the drive, and rebooted.
From the welcome screen that appeared I selected 1. Boot FreeBSD [default]'. The sysinstall Main Menu was then displayed; I then selected 'standard install' (in FreeBSD 6.1, the country and keymap selection screens appear before the Main Menu).
Then, FDISK the partition editor appeared. I pressed A (to use the entire disk), pressed S (to make the new FreeBSD partition bootable), then pressed Q to quit FDISK. I then told the installer to create a standard MBR (since I'm not doing multiboot). [Note to fellow DOS refugees: FreeBSD calls partitions 'slices'. FreeBSD has partitions too but they are different to DOS-style MBR partitions - in fact they are sub-slices, and are called labels.]
Next, the disklabel editor appeared; press A to create the default scheme. The disklabel editor can be tricky to use, especially if customising the label sizes. For reference, the following FreeBSD-style partitions are required:
/
swap
/tmp
/usr
/var
From experience thus far, 250Mb is the minimum required for /, /tmp and swap, 500Mb is the minimum for /var and 2Gb the minimum for /usr. /usr should be as big as possible. Smaller values may work, but will probably not be useful (especially over time). Think carefully before proceeding - ensure the scheme you define will suit the machine's intended usage (a mailserver, which by default puts spools in /var, will probably need an extra-large /var, for example). You may need to juggle the sizes of the various labels, particularly if you are installing on a disk 4Gb or less in size. Once the label sizes are defined, it's difficult to change them without reinstalling the system from scratch. Unfortunately, FreeBSD is not yet blessed with tools like Ghost and Partition Magic.
The partitions created, the installer prompts for an installation type - I chose Developer. The installer then asks whether to install the ports collection. If the ports collection is not installed, this can cause difficulty in some circumstances, so electing to install the ports here is recommended.
I then selected my installation media; the system files were then copied to the disk (this process takes some time). When the copy completed, a congratulations message appeared.
Next, install proceeded to the "final configuration questions". These vary depending on previous choices and the distribution being installed (docs: handbook).
Would you like to configure any Ethernet or SLIP/PPP network devices? .. Yes.. (I want to configure the network card):
select Ethernet card (it should be autodetected)
Do you want to try IPv6 configuration of the interface? .. No..
Do you want to try DHCP configuration of the interface? .. No..
The network configuration screen that then appears is pretty well the same as Windows' TCP/IP Properties box:
for the Hostname, enter a unique name for the machine - this is analogous to Windows' Computer Name setting
in the Domain box, I put my own domainname (eg. cyberdelix.net)
IPv4 gateway is analogous to Windows' gateway setting
nameserver is analogous to Windows' DNS server setting (changed later by editing /etc/resolv.conf)
enter an unallocated IP address into the IPv4 address box
set the netmask box appropriately (analogous to Windows' subnet mask)
leave ifconfig options empty
press OK
Would you like to bring the interface up right now? .. No..
Do you want this machine to function as a network gateway? .. No..
Do you want to configure inetd and the network services it provides? .. No..
Would you like to enable SSH login? .. Yes..
Do you want to have anonymous FTP access to this machine? .. No..
Do you want to configure this machine as an NFS server? .. No..
Do you want to configure this machine as an NFS client? .. No..
Would you like to customise your system console settings? .. Yes.. (I'm using a UK keyboard) [note: in FreeBSD 6.1, skip this section if the keymap was selected when the installer first started]
select keymap
select UK CP850
select exit
Would you like to set this machine's timezone now? .. Yes.. (then select the correct timezone)
Would you like to enable Linux binary compatibility? .. No..
Does this system have a PS/2, serial or bus mouse? .. No..
Do you want to browse the package collection now? .. Yes.. (install cvsup (net/cvsup-without-gui) and portaudit (security/portaudit))
Would you like to add any initial user accounts to the system? .. Yes.. (docs: handbook)
select group and create a group for your users (eg. "accounts")
select user and create a user - note the password down - make member of wheel group if this is the sysadmin's personal account
select exit
set root's password - note this down too
Visit the general configuration menu for a chance to set any last options? .. No..
...and the install was done - exiting the installer and rebooting let me login as root, and whizzo - I found I could immediately ping yahoo.com!
Note: if installing FreeBSD in a dual- or multi-boot system, a boot manager should be installed at this point (see below).
The next job was to get SSH working. During install, I said Yes, enable SSH login; while this generates keys and configures the SSH daemon to start on boot, it crucially does not automatically allow anyone to login remotely (including root). To permit a user to login:
edit the daemon's configuration file: vi /etc/ssh/sshd_config
uncomment the line PermitRootLogin no
go to the end of the file, add a new line: DenyUsers Administrator Guest Root
add a new line under that: #permitted users
add a new line under that: AllowUsers username@IP.address.you.use
save the changes to the config file and quit the editor
restart the SSH daemon: /etc/rc.d/sshd restart
username is usually the username associated with the sysadmin's personal account (created above, member of group 'wheel'). Do not permit root to login remotely. A more secure configuration is to permit a user who can 'su' to root instead.
IP.address.you.use is the IP address of the computer you use to connect to the server. Failing to add the AllowUsers line permits users to login from anywhere. Failing to add the IP address permits the user specified to login from anywhere.
Remember to restart the daemon after you save your changes to its configuration file. It only reads the file when it starts up.
Note: this configuration permits use of password-based authentication, which is vulnerable to brute-forcing. Key-based authentication (not covered here) is more secure. However, in the configuration above an IP address is specified on the AllowUsers line, which means that a brute-force attack can only be successful if it is made from that IP address.
Note: the rest of the build can be completed remotely, if desired. If this is the case, and a firewall is in between, forward the SSH port 22/TCP to the server now. Also, check that port 22/TCP is open on the firewall. It's good security to use an alternate port, if possible (forward, for example, firewall/external port 6666 to server/internal port 22 - you then specify port 6666 in your SSH client and the firewall maps the traffic to port 22 on the server).
denyhosts can be used to stop many kinds of brute-force attacks. While the SSH configuration above is quite
secure, using denyhosts gives an extra layer of security, and may allow some of the other restrictions to be
relaxed (eg. restricting login from certain IP addresses only). In addition, denyhosts can be used to simultaneously
block attacks on protocols other than SSH. denyhost's drawbacks include its Python dependency, and also its use of
TCP wrappers. However this use of TCP wrappers means that it does not need a firewall in order to operate.
How to install:
cd /usr/ports/security/denyhosts
make install clean
if prompted for Python configuration, make changes as necessary and continue
vi /etc/rc.conf
add these lines (if the syslogd_flags setting already exists, ensure it includes the -c switch):
denyhosts_enable="YES"
syslogd_flags="-c"
save the changes and exit the editor
vi /etc/hosts.allow
comment out this line:
ALL : ALL : allow
add these lines just before the sendmail settings:
the file /etc/hosts.deniedssh will be created by touch, if it does not exist
configuration options can be found in /usr/local/etc/denyhosts.conf
check that denyhosts is running with ps -ax|grep denyhosts
logfile is /var/log/denyhosts
denied hosts will be listed in /etc/hosts.deniedssh
failed connection attempts will be logged to /var/log/auth.log with a "refused connect" message
once denyhosts is running, if another daemon (say, mysqld) reports "refused connect" in /var/log/auth.log,
add a line to /etc/hosts.allow to permit traffic to that daemon. In the case of mysql, which will also report
"mysqld[483]: error: /etc/hosts.allow, line xx: twist option in resident process" in /var/log/auth.log, open
/etc/hosts.allow and add these lines after the SSH lines added above:
# mysql
mysqld : ALL : allow
All hosts will be then allowed to connect to mysqld. Ensure to remove any mistakenly blocked hosts from
/etc/hosts.deniedssh (denyhosts will probably have added any clients that attempted to use mysql while it was
blocked to the /etc/hosts.deniedssh file). A restart of denyhosts, mysqld or anything else is NOT required.
CVSup requires port TCP 5999 outbound open on the firewall.
The more ports there are installed, the longer the port update takes. It's possible to control which groups of ports are updated, however this is not covered here.
Failing to update the system would not only have left me with a bunch of bugs and security issues that have already been fixed, but would also have prevented me from installing most of the ports, since portaudit, which along with cvsup was installed when I installed FreeBSD itself, aborts the installation of outdated ports.
portsnap is used to update the ports collection, and replaces CVSup for this task (CVSup is
still needed to update FreeBSD itself, however). portsnap is installed with the base system, for FreeBSD 6 and up
(earlier versions require it to be installed from the ports collection). portsnap is more efficient and secure than CVSup.
To initialise portsnap, and update to the latest ports tree, do this:
portsnap fetch extract
Note: this command is only required when portsnap is first run.
To update the ports tree at a later time (eg. once portsnap has been initialised, as above):
portsnap fetch update
Notes:
portsnap will overwrite your existing ports tree in /usr/ports (including any mods you've made)
requires a live internet connection
the initial fetch and extract will probably take a while
portsnap keeps a complete compressed copy of the ports tree in /var/db/portsnap/ (approx 55Mb, in mid-2008)
configuration file: /etc/portsnap.conf
it is possible to refuse certain branches of the tree, however this is not recommended
An NTP daemon is installed by default; use this procedure to configure and start it:
edit startup file: vi /etc/rc.conf
add a line to end: ntpdate_flags="time.server.to.use"
add a line to end: ntpdate_enable="YES"
add a line to end: ntpd_enable="YES"
save the file and close the editor
create config file: vi /etc/ntp.conf
add a line: server time.server.to.use
add a line: driftfile /var/db/ntp.drift
save the file and close the editor
start the server: ntpd
Notes:
time.server.to.use is the address of the NTP server you wish to sync with (I'm currently using ntp.cs.strath.ac.uk). Try a search like this if you don't know of one.
if you only wish to sync with an NTP server, and don't wish to provide NTP service for other machines, simply make the first TWO changes to rc.conf noted above, and skip the rest of the instructions.
An FTP server is installed by default; use this procedure to configure and start it:
get into sysinstall
select Configure, then Networking
go down to inetd and press Enter
accept the warning
open the editor
uncomment the "ftp" line (tcp6 is apparently for IPv6 - I left this commented out)
save the changes and exit the editor, then quit sysinstall
if needed, add usernames to the banned user file: vi /etc/ftpusers
if needed, add usernames to the restricted user file: vi /etc/ftpchroot
if needed, edit welcome and motd files: vi /etc/ftpwelcome ... vi /etc/ftpmotd
start inetd: /etc/rc.d/inetd start
edit startup file: vi /etc/rc.conf
ensure the inetd_enable line is set to "YES"
if present, ensure TCP_extensions is set to "NO"
save any changes and exit the editor
Notes:
the configuration file is at /etc/ftpd.conf
the logfile is at /var/log/xferlog
to quote the FreeBSD Handbook: "Finally there is the TCP Extensions option. This enables the TCP Extensions defined in RFC 1323 and RFC 1644. While on many hosts this can speed up connections, it can also cause some connections to be dropped. It is not recommended for servers, but may be beneficial for stand alone machines."
comment out the line DaemonPortOptions=Port=587, Name=MSA, M=E (this stops sendmail listening on port 587)
save the file and quit the editor
run make in /etc/mail/ to update the databases
restart sendmail: /etc/rc.d/sendmail restart
Where yourdomain.com is the name of the domain for which mail is being processed. You must wait for DNS changes to propagate before you can test inbound mail processing.
This setup permits the server to relay mail sent by any machine on the LAN, and also removes the machine's hostname from any mail originating from the machine (ie. cron, mail).
There are many ways to use Samba. The configuration defined below emulates a shared drive on a Windows PC with minimal security. It can also be used emulate shared printers (in conjunction with CUPS). It does not require users enter a password - it assumes that any user on the local network is valid. This is done as follows:
cd /usr/ports/net/samba3
make install clean (again, this requires a live internet connection, and takes a while)
select at least syslog (and CUPS if you want to use the FreeBSD box as a printserver)
cd /usr/local/etc
cp smb.conf.default smb.conf
chmod 644 smb.conf
vi smb.conf
in the [global] section, change workgroup name to correct name, example: MY_GROUP
in the [global] section, set the security mode to user
in the [global] section, uncomment the hosts allow line and change it to permit access only from the local LAN and localhost, example: 192.168.0. 127.
in the [global] section, set domain master and preferred master as appropriate (this is not required, but I suspect it makes browsing the network faster)
in the [global] section, adjust log size if necessary (remember this is per machine)
create a section in the config file for the share (do this in the "share definitions" section):
[public]
path = /usr/data/smbspace
read only = no
public = yes
oplocks = false
level2oplocks = false
save the changes and exit the editor
create share directory: mkdir /usr/data/smbspace
set permissions on share directory: chmod 775 /usr/data/smbspace
vi /etc/rc.conf
add a new line to the end of the file to enable Samba on boot: samba_enable="YES"
save the changes and exit the editor
start the daemon: /usr/local/etc/rc.d/samba start
Samba has a web-based administration tool called SWAT, to install:
vi /etc/inetd.conf
uncomment the line starting with swat stream tcp nowait/400
save the changes and exit the editor
restart inetd: /etc/rc.d/inetd reload
SWAT will then be accessible at http://localhost:901/ (the root username and password are required)
Note that SWAT uses inetd. Enable it if necessary with the following:
vi /etc/rc.conf
add line to end: inetd_enable="YES"
Notes:
The smb.conf manpage is a good source of help for the config file, type man smb.conf to see the it.
Samba notices changes to its config file without being restarted, however this sometimes takes a minute or so.
the syntax of sbm.conf can be tested with the testparm command
Samba logs are kept in /var/log/samba
if there are problems, in smb.conf, set the log level to 3 (don't forget to set it back later)
CUPS (and printserving with Samba): (docs: sambaCUPS)
CUPS is not installed by default. Install it as follows:
cd /usr/ports/print/cups
make install clean (again, this requires a live internet connection, and takes a while)
from the Ghostscript installer that appears, deselect every printer, then continue (we're using raw mode)
vi /usr/local/etc/cups/mime.types
uncomment line near end starting with application/octet-stream (in FreeBSD 6.1 this is uncommented by default)
save the file and quit the editor
vi /usr/local/etc/cups/mime.convs
uncomment line near end starting with application/octet-stream
save the file and quit the editor
vi /usr/local/etc/cups/cupsd.conf
comment out the line Listen localhost:631
add a line below: Port 631
change the Allow line in the <location /> section to suit the LAN, eg. Allow 192.168.0.*
change the Allow line in the <location /admin> section to suit your system, eg. IP.address.you.use
save the file and quit the editor
IP.address.you.use is the IP address of the computer you use to connect to the server.
The Samba/CUPS interface must then be configured:
vi /usr/local/etc/smb.conf
in the [global] section, uncomment printing=cups
in the [global] section, add a line immediately underneath the one previously edited: printcap name=cups
in the [printers] section, add public=yes
in the [printers] section, add use client driver=yes
in the [printers] section, add printer admin=root
in the [printers] section, set guest ok = yes
in the [printers] section, ensure browseable = yes
in the [printers] section, ensure writeable = yes
save the file and quit the editor
enable and run CUPS:
vi /etc/rc.conf
add a new line to the end: cupsd_enable="YES"
save the file and quit the editor
start the server: /usr/local/etc/rc.d/cupsd start
Then configure a printer:
access the web interface: https://yourserver:631/admin/ (does not require Apache installed)
click Administration
login (as either root some other user)
click Add Printer
enter a printer name (descriptive only - appears as sharename when browsing for a printer)
click Continue
select Parallel Port #1 (interrupt driven)
click Continue
enter the device name: parallel:/dev/lpt0
select raw
click Continue
select raw queue
click Continue
This done, Windows users will be able to browse for the printer and add it as usual to their systems. They will be prompted for drivers which they must install locally.
Note: the above notes assume the printer is connected directly to the server's parallel port.
If the printer is connected via a printserver, substitute the protocol and device path above as appropriate, examples: lpd://192.168.0.90/p1 or lpd://yourprintserver/p2
Note: it may take a few minutes for the printer you have shared ("published") to become visible to client computers.
Note: if the server is being configured remotely with SSH, it's possible to create a tunnel to port 631, and then use a local web browser to connect, through the tunnel, to the CUPS control panel, using an address such as http://localhost:3000/ (where 3000 is the local port where the SSH tunnel terminates).
Note: the CUPS logfile, very useful for troubleshooting, can be found in /var/log/cups/
Note: the CUPS admin panel may autodetect network printers, if so it provides a wizard to add them to the CUPS configuration. However this wizard creates sharenames that are incompatible with/invisible to Windows 9x clients. Ensure to use short sharenames (11 characters or less) if Windows 9x clients are in use.
The printer will need to be added manually in order to define a sharename.
Note: printing under unix is not straight-forward, and I'm not an expert. While this section works, in that Windows clients can print to the unix printer, this section leaves out certain things (ie. the ability to print from the server to the printer, and loading Windows drivers onto the server).
MySQL is not installed by default. How to install and configure it from the ports collection:
install MySQL (this requires a live internet connection, and takes a while)
cd /usr/ports/databases/mysql50-server make install clean
configure the data directory
mkdir /data mkdir /data/db mkdir /data/db/mysql chown -R mysql /data/db/mysql/ chgrp -R mysql /data/db/mysql/
Note: the default directory MySQL uses is /var/db/mysql/ however it has been changed to /data/db/mysql/ in this example.
Note: a MySQL user and group are required, however these are created automatically by the installer.
initialise the database server
/usr/local/bin/mysql_install_db -u mysql --datadir=/data/db
Note: If a bunch of 'cannot find file' messages appear here, check the permissions on the data directory.
configure the environment
To enable MySQL to start on boot, add to /etc/rc.conf the following:
mysql_enable="YES" mysql_dbdir="/data/db/mysql"
reboot and test
If there are problems, check the file server.err in the MySQL data directory for error messages (the actual name of the file will not be server.err, "server" is substituted for your machine's hostname). Don't skip the reboot - it can fix at least one transient post-install issue.
set root password
mysqladmin -u root password 'secret_password'
grant administrative permissions
mysql -uroot -psecret_password -e"GRANT ALL PRIVILEGES ON *.* TO 'root'@'IP.address.you.use' IDENTIFIED BY 'secret_password'" mysql -uroot -psecret_password -e"GRANT SHUTDOWN ON *.* TO 'root'@'IP.address.you.use' IDENTIFIED BY 'secret_password'"
IP.address.you.use is the IP address of the computer you use to connect to the server.
Notes:
the file /etc/my.cnf can be used to fine-tune MySQL's performance
MySQL must be running for the mysql and mysqladmin commands to work
MySQL can be started manually like this: mysqld_safe -u mysql --datadir=/data/db/mysql &
MySQL can be restarted manually like this: /usr/local/etc/rc.d/mysql-server restart
deployment
When the server is fully built and as tested as possible, it can be launched, ready for use in a production (live) environment. If the server is to accept mail from the internet, the following additional items should be done before launch:
if your router has a dynamic public IP address, get a dynamic DNS account, and install a dynamic DNS client on the server (you can also roll your own DDNS client using cron and curl)
at your DNS provider, change the domain's MX record to point at your router's public IP address (or dynamic DNS hostname). This will cause all email for the domain you specify to be forwarded to the address you specify, so ensure the server is ready to accept it. This change will take 24-48 hours to take effect. Check MX records with this command: host -t mx domain.name
on your router, forward port TCP/25 (SMTP) to the server's private IP address (additionally ensure this port is open on the firewall)
To install the ports collection after FreeBSD has been installed: Sysinstall / Configure / Distributions / ports collection
To list installed ports or packages, use pkg_info or pkg_version -v
To uninstall either ports or packages, use pkg_delete portname
If the ports collection is not installed, software from it cannot be installed, including
Apache, PHP, Samba and Dovecot. Currently I'm stuck on this problem, and so I install the
full ports collection during installation.
dual-booting
I've only played with this a bit so nothing indepth here, however I did try installing FreeBSD on an empty second hard disk in a machine running Windows 2000 Server. During FreeBSD's install I elected to install the Boot Manager, as suggested by the installer, so I could select which operating system to boot.
However the Boot Manager seemed to corrupt my MBR. I got a nasty message from W2KS when I tried to log in - "your paging file is too small", a known fault but after running the fix and rebooting I got an even nastier message from W2KS asking me to reboot in Directory Services Restore Mode. At this point I broke out my Ghost image and restored my W2KS installation from a backup.
I found a third-party boot manager called GAG which did the trick. I reinstalled FreeBSD, this time telling it to leave the MBR alone, then installed GAG. Sorted.
the FreeBSD installer, sysinstall, can be accessed at any time by typing sysinstall from the command prompt
press alt-F1, alt-F2 etc to create or switch between virtual terminals (multiple user sessions) - this is perfect when a process is taking forever to complete (and works only on the local console, not via SSH)
test whether services are running using (on the server) ps -axfw, netstat -an, sockstat -4 and possibly telnet localhost and lpstat -a; on the client, test the server with port probes, CLI tools and end-user applications
startup/console messages are kept in /var/log/messages (this can be accessed with either dmesg or cat) - check out the rest of /var/log as well (especially when troubleshooting)
DOS refugees: the file /etc/rc.conf is similar in style and function to CONFIG.SYS (docs: manpage)
DOS refugees: FreeBSD comes with multiple shells (sh, bash, csh) - these work like COMMAND.COM
DOS refugees: FreeBSD has a PATH which works the usual way, type SET to see it
Microsoft filesystems can be mounted with the command mount -t msdosfs /dev/ad2s1 /mnt/fat (use ls /mnt/fat to access it) (use -r to mount the filesystem as read-only)
a CD/DVD can be mounted with the command mount /cdrom (before ejecting, use the umount /cdrom command)
before a shell script can be run it must be made executable, eg. chmod 744 script.sh
a shell script will only execute if the full path to the script is supplied eg. /usr/home/username/script.sh
see my unix basics page for a list of common shell commands