Wednesday, October 10, 2007

Digital Photo Management In Linux

Macs include the excellent iPhoto for no extra cost, and if you want to spend money the Aperture photo-management application is first-rate.They are strictly for managing and editing digital photos; they're not full-blown desktop publishing suites. So what does Linux offer for the ace digital photographer who doesn't want to splurge on a Mac? How about a few goodies like:

  • Multiple filetype support, including RAW, TIFF, and JPG, as well as host of others
  • Support for audio and movie files
  • Download and photo archive management
  • Light table for side-by-side image comparisons
  • Camera profile support
  • Batch processing
  • Image editing, including color, hue, red-eye correction, gamma, contrast, and white balance adjustments
  • Resizing, cropping, and changing aspect ratios
  • Read/write EXIF data and comments

You'll find these, and a lot more, in Digikam. Digikam is a sleek, fully-featured digital photo management application for KDE. What about non-KDE users? It runs fine in any Linux window manager or desktop environment, as long as you install the necessary KDE libraries.


From the Beginning

Starting out organized is the key to managing large photo archives sanely. Snapping your pics is just the first step. Then the real fun begins: downloading them to your PC, organizing, editing, printing, or making online photo galleries. Digikam has some nice tools for managing your photo collections, so today we'll learn how to do that.

While most digital cameras can be connected directly to a PC to download photos, I think it's better to use a USB card reader. They're inexpensive, around $20 or less, and usually a lot faster.

Digikam first creates thumbnails from your camera card. Then you select which images to download. Ctrl+left-click selects one at a time, Shift+left-click selects batches at a time. Images -> Select New Items is a quick way to find only new images that have not been downloaded already. Or just select "Download all." Then you get a nice dialog that lets you download your photos into an existing directory, or create a new one.

Once that is finished, close the download window and remove your camera card to prevent accidents. Open the directory containing your new pics, and Digikam again flings up a page of thumbnails. You can easily change the size of the thumbnails with the View menu. Click once on a thumbnail to open or close the image. You may also open an image, then navigate through your images with the little arrows on the bottom right.



Tagging and Albums

That's all the basic, easy stuff. Now it gets interesting, because as anyone with giant photo archives knows, cataloguing and finding the darn things is the hard part. Digikam has two good tools for managing your photos: tags and albums.

Albums are the individual directories that you create for your photos. Each album, like any directory, can have sub-directories. You can organize albums together with the Collection tag; right-click on any album and select "Edit Album Properties". Then find all the albums in a Collection with "Tools -> Advanced Search".

A fun and useful feature is you can right-click on the thumbnail of any photo in an album, and select "Set as Album Thumbnail." This replaces the boring blue folder icon.

Tagging is the power tool for picking out specific photos from your vast collection. Right-click any thumbnail or image and select "Assign Tag." You can assign multiple tags to a single photo, which is handy when your photos fit in multiple categories. For example, a beautiful mountain landscape could be tagged as "mountain, sky, forest". Then use "Tools -> Advanced Search" to find photos by their tags. After you create a new tag, Digikam automatically puts it into a drop-down list.

Shortcut Tabs

Notice the left-hand tabs: Albums, Dates, Tags, and Searches. Click the Dates tab to see all of your images automatically arranged by date, and a calendar at the bottom with the dates highlighted. The Tags tab is a great shortcut for Tag searches. On the right-hand set of tabs, the Commentary/Tags tab lets you add or remove tags quickly with checkboxes.

Tags can also be given custom icons. By default KDE will find the installed system and application icons. You can make your own custom icons with kiconedit or babygimp, which is more fun than recycling the stock icons.

Read more!

Linux - Database Security Explained

The most popular open source database for Linux, is MySQL. It's easy to install and configure, runs light, and is quite fast. You'll commonly see it harnessed to Apacheserving up site content and authenticating users and offering a tempting target to those with more time than sense or conscience.

Working from the outside into the crunchy database center, we'll cover:

  • The types of security problems. What should you worry about?
  • Server placement. Where should you put your MySQL server to protect it from TCP exploits? How can you provide secure access for database clients?
  • Database server installation. What version of MySQL should you use? What are the best file/directory ownerships and modes?
  • Database configuration. How do you create database user accounts and grant permissions?
  • Database operation. How do you protect against malicious SQL and bonehead queries? What are good practices for logging and backup?
For one reason or another, you might want to consider an alternative to MySQL. You can dip your toes in the commercial database waters (Oracle, DB2/UDB, Sybase) or stay in the open source pool. At the top of the open source list is PostgreSQL (http://www.postgresql.org/), which has more of the features of the big commercial relational databasesviews, triggers, referential integrity, subselects, stored procedures, and so on (although many of these features are coming to MySQL). Firebird (http://firebird.sourceforge.net/) is a spin-off of Borland's InterBase. Computer Associates has said it will release Ingres as open source (http://opensource.ca.com/projects/ingres/). SQLite (http://www.sqlite.org/) is an embeddable database that may become more well-known from its inclusion in recent releases of PHP.


Types of Security Problems

The problems a database server may encounter should sound familiar:

  • Server compromise. Any software, especially code written in languages such as C or C++, has the potential for buffer overflows, format-string attacks, and other exploits that are by now all too familiar. And software written in any language has logic errors and plain old blunders.

  • Data theft. Data can be extracted from the database even if everything seems to be configured well. It just takes one logical error or an overly permissive access control.

  • Data corruption or loss. The person in the mirror may do as much damage inadvertently as the hooded and cloaked database vandal does by design.

  • Denial of Service. MySQL is fast but does not always degrade gracefully under load. We'll see how far it bends before it breaks, and how to prevent the latter.

    Server Location

    Where should you place a database server? The main factors are:

  • Who will access the database?

  • How important is the data?

Exposing a database directly to the public might earn you a call from the Society for the Prevention of Cruelty to Databases. A public database server is normally an internal server, accessed only by other servers and clients behind the firewall. In this article, we'll look at examples of the most common database users: web servers and database administrators. We'll also show how to insert multiple layers of protection between the sensitive database server and the harsh weather of the public Internet.

The MySQL server listens for connections on a socketa Unix socket for connections on the same machine or a TCP socket for other machines. Its IANA-registered TCP port number is 3306, and I'll use this value in examples, but other port numbers can be used if needed.

How far from the Internet should the database be placed? Truly precious data (such as financial records) should be far back, on a dedicated database server within a second DMZ (internal to the DMZ that contains public-facing things such as web servers). The intervening firewall should pass traffic only between the database client (e.g., the web server) and database server on a specific TCP port. iptables should be configured on each machine so that the database client talks to that database port (3306) on the database server and the database server accepts a connection to port 3306 only from the host containing the web server.

For less precious data, the MySQL server may be on a dedicated machine in the outer DMZ, side by side with its clients. This is a common configuration for security, performance, and economic reasons. Configure iptables on the database server to accept connections on port 3306 only from the web server, and configure iptables on the web server to allow access to the database server on port 3306.

For local client access, MySQL can use a local Unix domain socket, avoiding TCP exploits. If a client accesses the host as localhost, MySQL automatically uses a Unix domain socket. By default, this socket is the special file /tmp/mysql.sock.

Secure Remote Administration

Although we worry most about the security of the connection between the database server and its major clients, we also need to pay attention to the back door: administrative use.

Database administration includes creating and modifying databases and tables, changing permissions, loading and dumping data, creating reports, and monitoring performance. The main methods for administrative access are:

  • VPN to the server

  • ssh to the server

  • Tunneling a local port to the server

  • Using the Web

VPN to the server

If you have a VPN (virtual private network) connecting your local machine and the database server, you can access the server as though you were in the DMZ. Open source VPNs include FreeS/WAN (http://www.freeswan.org), Openswan (http://www.openswan.org/), OpenVPN (http://openvpn.sourceforge.net/), and strongSwan (http://www.strongswan.org/). All are under active development except FreeS/WAN.

Cisco and many other vendors sell commercial VPN products.

ssh to the server

If you don't have a VPN, you can do what I do: ssh to the database server and run command-line clients such as mysql, mysqladmin, and mytop. The command line may give you more control (if you're used to text-filled terminal windows), but it can also be more tedious and error-prone. Still, it's a quick way to get in, fix a problem, and get out.

Tunneling a local port to the server

If you'd like to use GUI tools like MySQL Control Center, Administrator, or Query Browser on your local machine, you can tunnel your MySQL port through the intervening firewalls with ssh or stunnel . If your server is db.hackenbush.com and your Unix account name is wally, enter:

ssh -fNg -L 3306:127.0.0.1:3306 test@db.test.com
If you haven't generated a public key on your machine and copied it to the database server , you'll be prompted for your ssh passphrase. This command tunnels port 3306 on your machine over ssh to port 3306 on the database server.

Test it with a client on your own machine. Try this:

mysql -h 127.0.0.1 -u test -p
Type your MySQL password when prompted. If this works, all of your local clients will be able to access the database.

grant all on *.* to test@localhost identified by 'password'

If you are running MySQL on your local machine and already using TCP port 3306, use a different port for the first value and specify that port in your client calls later. Let's use port 3307:
ssh -fNg -L 3307:127.0.0.1:3306 test@db.test.com

mysql -P 3307 -h 127.0.0.1 -u test -p
Using ssh to tunnel your MySQL traffic makes you dependent on the security of the SSH server on the database machine. A safer approach is to use a VPN to connect to another machine in the DMZ (an access point), then ssh or stunnel to the database server. This two-step approach is a little safer than a direct VPN or ssh connection between your local machine and the database server.

Using the Web

There are many web-based MySQL administrative interfaces, but my favorite is phpMyAdmin (http://www.phpmyadmin.net). You should use HTTP over SSL (URLs start with https:) to protect your connection. Even so, the Web is a tough environment to secure. I never feel quite safe using web-based admin tools and tend to fall back on ssh or tunneling. You might compromise by using web tools during the design phase with a test database and move to other administrative tools for deployment.

Server Installation

Now that you've located your database server to protect against TCP exploits, you need to select a safe version of MySQL to guard against any code-based vulnerabilities.

Choosing a Version

Bug fixes, security fixes, performance enhancements, new features, and new bugs are part of each new server release. You always want the most recent stable version. At the time of writing, MySQL Server 4.1.13 is production, and 5.0 is the development tree. Old 3.x releases still abound, the most recent being 3.23.58. If you're running an older version of mySQL, make sure it's newer than 3.23.55 to avoid a remote MySQL root account (not Linux root) exploit. Make the move to 4.1 if you can, because there are many improvements. Here are some useful links to keep up with new problems as they're discovered:

Vulnerabilities

http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=mysql


Bugs

http://bugs.mysql.com/search.php


Change logs

http://dev.mysql.com/doc/mysql/en/News.html

Installing and Configuring the Server and Clients

MySQL comes standard with Red Hat and Fedora, as RPM packages mysql-server and mysql (clients and libraries). If you install from RPM, it creates the startup script /etc/init.d/mysqld and the links to it from the runlevel directories (/etc/rc[0-6].d). If you want to install from source, see the latest details at http://dev.mysql.com/doc/mysql/en/Installing_source.html.

When the MySQL startup script is run by root, it should call another script called safe_mysqld (server Version 4.0 and newer) or mysqld_safe (pre-4.0), which is typically in /usr/bin. This script then starts the MySQL server as user mysql. The database server should not run as the Unix root user. In fact, mysqld won't run as root unless you force it to with --user=root.

Setting the MySQL root User Password

MySQL account names look like Unix account names, but they are not related. In particular, MySQL root is the all-powerful MySQL account but has nothing to do with Linux root. If you try to access MySQL without providing a name, it tries your Linux account name as the MySQL account name. So, if the Linux root user types:

# mysql

it's the same as anyone else typing:

% mysql -u root

The initial configuration of MySQL is wide open. If you can get in with:

% mysql -u root

then you need to create a MySQL root password. To set it to newpassword:

mysqladmin -u root password newpassword

You really shouldn't use the Linux root password as the MySQL root password.
You can even change the name of the MySQL root account, to trip up attackers who might try to crack its password:

mysql -u root ...

mysql> update user set user = 'admin' where user = 'root';

Although Linux has many tools to improve the security of its user accountsincluding a minimum password length, account expirations, login rejection after repeated failures, and password look-ups in dictionariesMySQL does none of these for its database accounts. Also, MySQL's fast login process enables a cracker to automate fast password attacks. Passwords are stored as an MD5 hash rather than the original text, so dictionary attacks using precomputed MD5 hashes of common passwords are a threat.

If you want to ensure that your passwords are good enough, some MySQL password crackers are:

http://packetstorm.linuxexposed.com/Crackers/mysqlpassword.c

Deleting Anonymous Users and Test Databases

Out of the box, MySQL has a test database and some phantom users that leave open potential risks. Let's whack them. Now that you have a MySQL root user password, you'll be prompted for it:

% mysql -u root Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 to server version: 3.23.58 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>use mysql;
Database changed

mysql>delete from user where user = "";
Query OK, 2 rows affected (0.00 sec) mysql>drop database test; Query OK, 0 rows affected (0.01 sec)

mysql>quit
Bye

Checking Your Server

If setting up your database server feels like as much work as raising cattle, but without the glamor, you may mix business with pleasure and perform some virtual cow tipping: sneak up on your database server and try to push it over. From outside your firewall, see if nmap can prod port 3306. Have nessus poke MySQL holes, including a missing root password or insecure server version. A search for MySQL at http://cgi.nessus.org/plugins/search.html shows nine separate plug-ins.

Some tools that I have not yet tested, yet look promising, include http://www.zone-h.org/files/49/finger_mysql.c and a commercial vulnerability assessor called AppDetective (http://www.appsecinc.com/products/appdetective/mysql/).

The MySQL Configuration File

The file /etc/my.cnf contains overall directives for the MySQL server. Here are the contents of a simple one:

[mysqld]

[mysql.server]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

datadir is the directory containing the database directories and files. socket is the file name of the Unix-domain socket for MySQL to use for local connections. user is the Unix user who runs the database, and should not be root.

Some variables may be added under the [mysqld] section to defend against Denial of Service attacks, or just to tune the server. The format is:

set-variable=variable=value

You can see the current values of all the server variables with the SQL command SHOW VARIABLES. The variables and their meanings are described at http://dev.mysql.com/doc/mysql/en/Server_system_variables.html. The MySQL server can avoid some

Database Operation

Now that you've installed a reasonably secure version of the server in a reasonably secure location, let's look at how to run the thing securely.

MySQL Table Types

Many new developers of MySQL-backed web sites have been horrified to watch their database fall over and sink into the swamp just as their site becomes popular. Although MySQL has a reputation for speed, this is primarily in cases where database reads greatly outnumber writes. Once the number of simultaneous writes crosses some threshold, performance degrades most ungracefully.

This is a self-inflicted Denial of Service by the implementation of the default MySQL table type: MyISAM. It locks the whole table with each write (INSERT, UPDATE, or DELETE), pushing back all other requests. It's like closing all check-in lines but one at a busy airport terminal. Waits lengthen until the administrator must kill database threads or restart the database server.

MySQL actually has multiple table types, each implementing a different storage mechanism and behavior. You'll usually deal with two: MyISAM and InnoDB. MyISAM is great for reads and counts (such as COUNT * FROM TABLE), bad for heavy writes, and lacking true transactionsthe ability to perform multiple SQL statements as a unit and roll back to the original state if there are problems.

InnoDB is more recent, with full transaction support (ACID compliance, for the database folks), foreign-key constraints, and finer-grained locking. It's preferred when there are many writes or a need for transactions. People who are used to MyISAM should be aware that COUNT(*) is much slower in InnoDB tables. InnoDB is more complex and has many specialized options.

If you're just starting with MySQL, try MyISAM first and move up to InnoDB later if you need the write performance or transaction support. Luckily, you can do this with a single SQL command:

alter table table_name type=innodb

Many public MySQL-based sites such as slashdot.org have migrated from MyISAM to InnoDB.

Loading Datafiles

If you have FILE privileges, you can bulk load data from a flat file to a MySQL table. This has obvious security implications.

The SQL LOAD DATA command reads a flat file on the database machine into a MySQL table. This could be used to load /etc/passwd into a table, then read it with a SQL SELECT statement. Since end users should not be stuffing files into tables, it's best to restrict this to administrative accounts. For example, if you need to load a flat file into a particular table every day, create a MySQL account for that purpose and grant it load privileges:

GRANT FILE ON database.table TO user @host identified by "password"

The SQL LOAD DATA LOCAL command allows the database server to read files from the client. This permits an evil server to grab any file from the database client, or an evil client to upload a file of its choice.

Recent versions of MySQL (3.23.49+ and 4.0.2+) are compiled to include an explicit --enable-local-infile option for backward compatibility. To disable this ability completely, they can be compiled without this option. Local loads can also be disabled at runtime by starting mysqld with the --local-infile=0 option.

Writing Data to Files

The SQL command SELECT ... INTO OUTFILE dumps the results of the select operation into an external file. This is another good reason not to run the server as Unix root. The FILE grant permission is needed to write files. There doesn't seem to be a way to grant read-only or write-only permissions.

Viewing Database Threads

Any user with PROCESS privilege can view the cleartext of any currently executing database server threads (with SQL SHOW PROCESSLIST or clients such as mysqladmin processlist or mytop). This includes threads containing password changes, so the privilege should be confined to those who would normally be permitted to view such things.

Killing Database Threads

A user can always kill his own threads, but with SUPER privilege, he can kill any thread. Confine this privilege to administrators.

Stopping the Server

Anyone with SHUTDOWN privilege may stop the MySQL server by running mysqladmin shutdown. The mysql user may also stop the server at the operating system level with commands such as service mysqld stop.

Backups

A database administrator should periodically dump tables to files in case data becomes lost or corrupted and needs to be recovered. The mysqldump client writes all the SQL commands needed to re-create the tables and insert all the data rows. The backup file permissions should only allow reading and writing by the mysql user and group.

Logging

MySQL writes logs to record errors, queries, slow queries, and updates. These are normally written to the same data directory that contains the MySQL database. Besides protecting these files from snooping, they should be rotated before they fill up the disk. Red Hat includes a mysql-log-rotate script as part of its logrotate package.

Replication

To enhance speed and reliability, MySQL can be configured to replicate data in many ways.

Queries

Database servers have some of the same problems as web servers. Each has an embedded language that can be abused or exploited.

If the database is suddenly running very slowly, the cause may be benign (a slow query) or some attack. A good tool to view and kill runaway queries is the Perl application mytop (http://jeremy.zawodny.com/mysql/mytop/).

If the cause is a valid but slow query, database books describe the art and science of query optimization, including building proper indexes, using EXPLAIN to see how a query would be handled, denormalizing, and so on. Some optimizations might include using the appropriate MySQL table type. For example, Innodb tables handle high write/read ratios better than MyISAM tables.

Resources

http://www.mysql.com

Home of MySQL.


http://dev.mysql.com/doc/mysql/en/Security.html

MySQL general security issues.


http://jeremy.zawodny.com/mysql/mytop/

mytop is top for MySQL, an indispensable display of database traffic. Helps you to see and kill runaway queries.

Read more!

Tuesday, October 9, 2007

Safeguard your Office 2007 files with encryption, document protection, and digital signatures

In today's business environment, we expect more from office productivity software than just the ability to send and receive e-mail, format documents, produce spreadsheets, and create slide presentations. We also want a way to protect those files from unauthorized access, infiltration of malicious code, and even misuse by those with whom we share them.

Many security mechanisms to help protect our files are in play on modern networks. Firewalls help keep intruders from accessing the network on which the files are stored. Antivirus programs check documents and e-mail messages for viruses and other malware. IPSec can be used to encrypt data so that it can't be viewed at the packet level if it's captured while traveling across the network. Access controls, file level permissions, and EFS encryption can be used to keep unauthorized persons inside the organizations from gaining access to the files.

But the best security strategy is a multilayered one, and the more layers there are, the better. Even with network-level protections and the security mechanisms built into modern operating systems, it never hurts to have extra protections built into the applications, as well. Microsoft Office 2007 has a number of data protection features that help to protect the confidentiality and integrity of files created with Microsoft Word, Excel, and PowerPoint. In this article, we'll look at:

  • How to use document encryption to password-protect documents.
  • How to restrict formatting and editing of documents.
  • How to use digital signatures to ensure that documents and messages aren't changed in transit.

In a follow-up article, we'll explain:

  • How to use Information Rights Management (IRM) to keep recipients of documents and messages from copying or saving them or forwarding them to others.
  • How to check documents for hidden personal information before sending them to others.
  • How to use the Trust Center to protect your privacy and protect against harmful content in documents.
Document encryption/password protection

The password protection in Office 2003 was often criticized because of the weakness of its encryption. Although it used the RC4 stream cipher with a 128-bit key, the initialization vector (IV) and same keystream were used to encrypt the document each time you did so. That meant a hacker could crack the password by comparing two versions of a password-protected file. No hacking skills? No problem. Several software products are marketed as "password recovery tools" for cracking Office 2003 passwords.

Office 2007 uses AES (Advanced Encryption Standard) with a 128-bit key and SHA-1 hashing. For stronger protection, you can increase the key length to 256 bits by editing the registry or using Group Policy. This improves the security of password-protected files, especially when long, complex passwords are used.

Compatibility with previous versions of Office

What if you need to share encrypted files with users who are still running older versions of Office? Users running Office XP or Office 2003 can open and read files encrypted with the Office 2007 programs if:

  • They are running an operating system that supports AES (Windows XP SP2, Windows Server 2003, or Windows Vista) and
  • They install the Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats (which can be downloaded from the Microsoft Web site.
How to encrypt a file in Office 2007

To encrypt a file with password protection in Word, Excel, or PowerPoint, start by clicking the Microsoft Office button at the top-left corner of the Office program window. Select Prepare and then Encrypt Document, as shown in Figure A.

Figure A

To encrypt a document, select Prepare from the main Office Logo menu.

Enter a strong password (at least eight characters, containing upper- and lowercase alpha characters, numbers, and symbols) into the Password field, as shown in Figure B. Retype the same password when prompted to do so.

Figure B

Enter a strong password to encrypt the contents of the file.

You can save the file in either the Office 2007 format (.docx, .xlsx, or .pptx) or in the Office 97-2003 format (.doc, .xls, or .ppt). If you attempt to save in the older format, you'll see a dialog box advising you that the XML formats provide stronger encryption and asking if you want to convert to the XML-based format to increase the security of the document, as shown in Figure C.

Figure C

The Office 2007 XML-based formats provide stronger encryption than the old Office 97-2003 formats.

Now when you or anyone else tries to open the document, a dialog box will open, prompting for the password, as shown in Figure D.

Figure D

You must enter the password to open the file.

In addition to the file encryption password you can set on a document, Office 2007 allows you to set a file-sharing password. The encryption option is called the password to open, and the file-sharing password is called the password to modify.

To set a password to modify, you use the Tools in the Save As dialog box (this is also another way to set a password to open). Just click the Office Logo button and select Save As. Then, in the Save As dialog box, enter a name for the file, click the down arrow beside Tools, and select General Options, as shown in Figure E.

Figure E

A second way to set a password is through the General Options selection in the Save As dialog box.

In the General Options dialog box, you can type a password to open and/or a password to modify, as shown in Figure F.

Figure F

You can set both a password to open and a password to modify.

Note that the file-sharing password does not encrypt the document and is not a security measure. The General Options dialog box also allows you to open the Macro Settings section of the Trust Center, which we'll discuss later in this article.

Formatting and editing restrictions

Clicking the Protect Document button in the General Options dialog box enables restriction of formatting and editing (which can also be done from the Protect Document selection on the Review tab of the Office ribbon). Sometimes, you want to distribute a document to others but don't want them to make changes to the formatting -- or want to limit them to only certain types of editing (such as inserting comments).

You select and apply formatting and editing settings through the task pane shown in Figure G.

Figure G

Enabling formatting and editing restrictions with the Protect Document button opens the Restrict Formatting And Editing task pane.

You can limit formatting to only the style(s) you used, as shown in Figure H.

Figure H

You can restrict formatting to selected styles only.

This prevents others from changing the styles or applying direct formatting to the document. You can also choose whether to allow AutoFormat to override the formatting restrictions, to block theme or scheme switching, and/or to block Quick Style Set switching. (By default, none of these options is enabled.)

If the document contains formatting or styles you have disallowed, you'll be asked if you want to remove them.

You can restrict editing to:

  • No changes (read only)
  • Comments
  • Filling forms
  • Tracked changes

If there are parts of the document you want others to be able to edit freely, you can designate those selections as unrestricted or you can allow only specified persons to change those parts of the document. This is done with the Exceptions option in the Formatting And Editing task pane.

Select the block of the document where you want to permit editing and either select Everyone from the Exceptions list or click More Users and enter the user names of those who should be permitted to edit the selection.

With this feature, you can allow one person to edit one section of the document, another person to edit the next section, and so forth. For example, you might allow someone from the legal department to edit a section that deals with legal issues but prevent that person from editing the sections that deal with technical issues.

Once you've set the restrictions and exceptions you want, click the Yes, Start Enforcing Protection button. Then, in the Start Enforcing Protection dialog box, shown in Figure I, choose the option to protect with a password only (no encryption) or with user authentication (document is encrypted and Restricted Access is enabled).

Figure I

You can enforce formatting and editing protection with a password only or with encryption

Digital signatures

Digital signatures are used to verify the authenticity of the creator or sender of a document or message and to ensure that the message hasn't been intercepted, with its content surreptitiously changed after it left the sender. (This is called document integrity.) Signing a document does not encrypt it.

How digital signatures work

Digital signatures use digital certificates that are issued by a trusted third party called a certification authority (CA). The CA is a server running certificate services software, such as the Certificate Services included in Windows 2000 Server and Windows Server 2003. The CA can be internal, running on a computer on a company's local area network, or it can be an external or public CA, such as those run by VeriSign, Thawte, and other companies. Either way, the CA verifies and vouches for the identity of the user or computer to which it issues a digital certificate.

The digital certificate is based on asymmetric or public key cryptography. The certificate contains the user's name and a public key that is associated with the private key the user uses to sign messages, as well as a serial number, expiration date, and the digital signature of the CA.

Compatibility with previous versions of Office

Although older versions of Office also support digital signing, they use a different format for digital signatures. Office 2007 programs use the XMLDSig format, which is not compatible with previous versions. Thus if a user running Word 2003 attempts to open a document that was signed in Office 2007, a dialog box will appear, informing the user that the digital signature has been lost.

How to add digital signatures to Office 2007 messages and documents

You can add digital signatures to Word, Excel, and PowerPoint 2007 documents and Outlook 2007 e-mail messages.

In Outlook, you can digitally sign individual messages or you can configure Outlook to digitally sign all outgoing messages. To sign a message individually, create the message and then, on the Message tab, click beside Options to open the Message Options dialog box shown in Figure J.

Figure J

Click Security Settings to add a digital signature to an e-mail message.

Click the Security Settings button and then select the Add Digital Signature To This Message check box, as shown in Figure K.

Figure K

You can send the signed message as clear text and/or request a Security MIME receipt.

If you don't already have a digital certificate associated with the e-mail address from which you're sending the message, you'll see an Invalid Certificate warning, which tells you how to get a digital ID to use with the account, as shown in Figure L.

Figure L

If you don't have a digital ID to use with the e-mail account, you'll get an Invalid Certificate message.

Tip

You can get a free digital ID for personal e-mail from Thawte.


To digitally sign all outgoing messages automatically, you use the Trust Center, which we will discuss in our follow-up to this article.

You can digitally sign a Word, Excel, or PowerPoint file in one of two ways:

  • Transparently
  • With a signature line

A transparent signature provides assurance of the authenticity and integrity of the document without being visible within the document itself. A Signatures button shows up on the status bar at the bottom of the application window. After you add the signature, the document becomes Read Only so that it can't be changed.

To add a transparent signature, click the Microsoft Office button at the top-left corner of the application window and select Prepare, then Add A Digital Signature, as shown in Figure M.

Figure M

Add a digital signature to a Word, Excel, or PowerPoint file from the Microsoft Office menu.

If you haven't yet saved the document, you'll be notified that you must save it before you can sign it, and the Save As dialog box will appear to allow you to do so. Then, the Sign dialog box appears, showing the user name that will be used to sign the document and providing a space where you can enter a reason for signing the document, as shown in Figure N. You can leave the Purpose field blank if you wish.

Figure N

Click the Sign button to sign the document.

You can change the user by clicking the Change button. Only user names that have certificates will be available. To sign the file, click the Sign button. A Signature Confirmation dialog box will appear, notifying you that the signature has been saved with the document. Now if the document is changed from this moment forward, the signature will become invalid and anyone who opens the document will be notified to that effect. If there are problems with a signature, the Signatures task pane will display, indicating the problem.

A small red ribbon icon in the status bar of the application indicates that a document has been signed.

You can also add digital signature lines to a document, so that signers can add their own digital signatures. To do so, click the Insert tab on the Office ribbon, click the Signature Line button, and then select Microsoft Office Signature Line. This will open the Signature Setup dialog box, shown in Figure O.

Figure O

You can insert signature lines where you and/or others can sign the document.

Here, you insert the signer's name, title, and e-mail address, as well as any special instructions to the signer(s). You can insert multiple signature lines in a document.

You can allow the signer to add comments in the Sign dialog if you want (this is disabled by default) and you can have the Office application automatically insert the date in the signature line (this is enabled by default).

The signature line will be inserted into the document as shown in Figure P.

Figure P

The signature line is inserted into the document and awaits the user's signature.

When you double-click the signature line, the Sign dialog box will appear, as shown in Figure Q.

Figure Q

The Sign dialog box allows the signer to sign the signature line.

The document signer signs the document by doing one of the following:

  • Typing his/her name into the signature field
  • Handwriting his/her name with a pen (in a Tablet PC)
  • Inserting a graphic file containing an image of his/her handwritten signature

After the document is signed, a dialog box notifies you that the signature has been saved with the document and the date is inserted (if you checked that option) above the typed or handwritten signature in the document, as shown in Figure R.

Figure R

The typed or handwritten signature appears in the document and the digitally signature is saved with the document.

The Signatures task pane will appear on the right side when the document is opened in Office 2007, notifying you that the document is signed. Any changes will invalidate the signature and the red ribbon icon will appear in the status bar, as shown in Figure S.

Figure S

The Signatures task pane indicates that the signature is valid.
Summary
A number of mechanisms are built into Office 2007 that can be used to protect your documents and e-mail messages. In this article, we looked at three of them: document encryption, formatting and editing restrictions, and digital signatures. In our next article, we'll discuss Information Rights Management (IRM), checking documents for personal information before sending them, and using the Trust Center

Read more!

Monday, October 8, 2007

Password Recovery Tools & Tricks

Here are several techniques you can use to either change or recover a lost password. Most of them involve using hacker tools and administrative utilities.

Using the system account to your advantage
If you're running Windows NT 4.0, you can actually change any password, including the Administrator password, without using any tools at all. This technique exploits the system account, which is built-in and normally used to run only specific services. As you might guess, the system account has unlimited privileges. The trick is to make it work to your advantage.

Any time you log on to Windows NT 4.0, it runs the Spooler Service. Since the Spooler Service requires a lot of permissions, it's run by the system account instead of running under the privileges of the user who's logged in. Therefore, if you can trick the system into running User Manager instead of the Spooler Service, User Manager will be running with all the privileges of the system account. This gives you free rein over any user account on the system.

Although it might sound tough to trick the system into running an alternate file, it really isn't. Just log on to the machine using any known username and password. The account's permissions are irrelevant at this point. Once you've logged on, rename the Spoolss.exe file to Spoolss.bak. Then, rename Usrmgr.exe to Spoolss.exe. Reboot the system, and you'll have unlimited access to the user accounts through User Manager. Just don't forget to rename the files to their original names and reboot the system when you're finished.

ERD Commander
My all-time favorite password utility is ERD Commander from Winternals Software. The idea behind ERD Commander is that you can boot the machine using a set of floppy disks or a CD. Rather than booting to Windows, you're booting to the ERD Commander's own operating system. By doing so, you have access to the system's partitions, but Window's security is not in effect. This gives you the freedom to do what needs to be done without any restrictions. ERD Commander allows you to reset the Administrator or any other password without logging on to the system. All you need is physical access to the machine.

One of the things I like about ERD Commander is that it's based on the original Windows code. This means that if your hard disks are part of a RAID array, the utility will still recognize them, in most cases. You can access and reset the Administrator password on a machine with almost any hardware configuration.

ERD Commander is available from Winternals for $399. It's also included in the Administrators Pack, which offers even more cool utilities, for $699.

Password Recovery XP
So far, this article has focused on cracking the Windows logon password. However, many applications maintain their own passwords. If you require administrative access to such applications, you must know the application-level password. The problem is that these types of passwords are easily forgotten because they tend to be used so infrequently. There are lots of specialized crackers available on the Web for cracking all sorts of applications' passwords. But one general cracking utility recently caught my eye.

Password Recovery XP from iOpus can recover just about any password that's masked by asterisks. Although lots of utilities can reveal these types of passwords, Microsoft recently changed its password-encoding scheme. As a result, the vast majority of password crackers designed to crack masked passwords will work only in pre-Windows XP environments. Password Recovery XP is designed specifically to work with all versions of Windows.

Password Recovery XP has minimal system requirements. On a hardware level, it requires a 486 or higher processor and 1 MB of hard disk space. The utility is equally lenient with operating systems, supporting Windows 95, 98, Me, NT, 2000, and XP.

You can go to the iOpus Web site and either download a free trial of the software or buy the full version. The free trial will reveal only the first three characters of passwords you attempt to recover. That may not always be enough to help you guess the passwords stored on an unfamiliar system, but at least you can determine whether the software will work on your system before you shell out the money for the full version.

The price for the full version is $29.95, plus $7.99 for shipping and handling if you want the software on CD-ROM. Before you purchase the software, though, be advised that the license is based on the machine rather than on the user. To stay legal, a support tech will need to buy a separate copy for every machine that he or she plans on using the software with.

Using the software is extremely simple. The download arrives in the form of a self-extracting executable file, and the installation process is almost completely automated. Once the software has been installed onto a machine, you can run it by selecting the iOpus Password Recovery XP command from the Start | All Programs | iOpus Password Recovery XP menu.

When the program initiates, you'll see an interface similar to the one shown in Figure A. Simply click on the key icon and then drag it to the field containing the password you're trying to decrypt. The decrypted password will then appear within the Password Recovery XP window. The decryption process is extremely fast. In my own experimentation, I had a little trouble decrypting some Web-based passwords, but all of the others that I tried were quick and easy to decrypt.


Figure A
This is the iOpus Password Recovery XP interface.


Hacker tools
So far, I've been showing you techniques that you can use to recover lost passwords either directly through the operating system or by using legitimate commercial applications. However, you shouldn't rule out using hacker tools if they help you to accomplish the task at hand.

Before you go scavenging around the Internet for hacker tools, though, I need to offer a word of caution. In general, hacker Web sites can't be trusted. You should exercise extreme caution when downloading hacker utilities because you never know what you might be getting.

Red Button
If you're trying to do some work on a computer, and no one knows the Administrative password, there's a possibility that the owner of the computer may not even know the name of the Administrator account. After all, renaming the Administrator account has long been a popular security technique. If the system is running Windows NT, though, you can use a hacker tool called Red Button to find out whether the Administrator account has been renamed, and if so, its new name. You can see a sample of Red Button in Figure B.

Figure B
Red Button can tell whether the Administrator account has been renamed


You might have noticed that in the figure, the built-in Administrator account was listed as N/A. That's because when I was writing this article, I didn't have a Windows NT server handy, so I ran Red Button against a Windows 2000 server. Microsoft designed Windows 2000 in a way that would prevent the name of the Administrator account from being compromised.

Dictionary and brute-force password cracking
If you haven't been able to use any of these techniques to crack the elusive Administrator password, you might consider performing a brute-force crack as a last resort. This approach has its good and bad points. On the positive side, a properly performed brute-force password crack is pretty much guaranteed to work. It simply tries every possible combination of numbers, letters, and symbols until it finds one that matches the password hash.

On the downside, a brute-force crack can take a long time. For every character in the password, the cracking time increases exponentially. For example, suppose for a moment that you were performing a brute-force crack on a password that could contain only the numbers 0-9. A one-character password would have 10 possible combinations; a two-character password would have 100 possible combinations; and a three-character password would have 1,000 possible combinations.

In that example, I used numeric passwords to keep the math easy. In the world of PCs, though, there are 256 possible values for each digit in the password. Some of those values are invalid, but even so, a one-character password could have 256 possible values; a two-character password could have 65,536 possible values; and a three-character password could have 16.7 million possible combinations.

If, after seeing these staggering numbers, you think that a brute-force crack could take forever, you're right. But what's weird is that a good brute-force cracker can crack a four-digit password in a matter of just a few minutes. Over the course of a day, you might be able to crack up to a seven-digit password (depending on your software and the speed of your machine). However, the amount of time required to crack a password goes way up for anything beyond seven digits. Although a seven-digit password could conceivably be cracked in a day, I've seen it take well over a week (running 24/7) to crack an eight-character password.

With any luck, you can find a password-cracking technique other than brute force that works for you, especially if the machine's previous administrator was really into using long passwords. If you do have to use a brute-force cracker, though, my tool of choice is LOphtCrack.

The current version of LOphtCrack requires administrative access before you are allowed to crack passwords. However, the LOphtCrack Web site contains some utilities you can use to extract password hashes from the registry. You can then use LOphtCrack to crack the hashed passwords. I'm not sure whether the current version supports this type of cracking, but some of the older versions floating around the Web do.

The reason LOphtCrack is one of my choice tools is that it optimizes the cracking process by first running a dictionary-based crack. As the name suggests, a dictionary crack tests words found in a dictionary to see whether they match the machine's password. Most dictionary-based cracks search for common terms, common misspellings, and technical terms. For example, if your password is PASSWORD, a dictionary crack would have no trouble deciphering it. If your password is WhAtz~Da*PasssWoyd, there's no way that a dictionary-based crack would work, and you'd have to rely on brute force.

Cracking up
Passwords can add security to your network, but they can also cause you headaches. When passwords get lost, you need a way to get them back. Using the tools discussed here, you may be able to recover lost passwords and get back to other, more pressing jobs.

Read more!

Convert an MPEG video file into Flash video

Converting an MPEG, AVI, or QuickTime video is a simple process that involves using Adobe’s Flash Video Encoder, a separate program that installs on your hard drive in conjunction with the installation of Flash CS3 itself. If you already have Flash CS3 on your computer, you can open the Flash Video Encoder from the Start Menu.

If you don’t own a copy of Flash CS3, you can download a fully functioning 30-day trial from Adobe. If you don’t have multiple MPEG, AVI, or QuickTime files of your own to use in this exercise, you can download a couple of low-resolution stock QuickTime files from FreeStockFootage.com and save them to your hard drive.

Oddly, Flash CS3 does not provide a stand-alone FLV viewer for watching FLV files from your hard drive. But you can download a free FLV player if you need one.

Converting files

Begin by opening the Flash Video Encoder if you haven’t already. You should see a screen resembling Figure A.

Figure A

The Flash Video Encoder

Click on the Add… button in the upper-right corner. This will open a dialog box that you will use to locate one of the MPEG, AVI, or QuickTime files on your hard drive that you will be converting to FLV format.

After you have added a source video file, it will be listed at the top of the Encoder’s Queue, with a default setting of Medium Quality. (Figure B)

Figure B

The first source video added to the Queue

The Flash Video Encoder is set up for batch processing of videos, so if you had a large number of videos you wanted to convert to FLV format, you would simply add them to the Queue by clicking the Add… button and listing an unlimited number of source videos so that the Encoder could process them all automatically in the order you listed them.

Let’s add a second video to the Queue now. Click the Add… button again and locate another source video you wish to convert to FLV format. When you are finished, the Queue should resemble Figure C.

Figure C

The second source video added to the Queue

Many people convert their source videos to FLV format for posting on video-sharing sites such as YouTube. However, most of these sites will automatically downgrade the quality of the video to help conserve their bandwidth. If you want to ensure a high-quality FLV file makes it online intact through one of these video-sharing services, you will need to change the default Quality Settings before you convert your source video.

For the sake of comparison, let’s just change the settings for the second video in the Queue. Select the second video in the Queue window and then click on the Settings button on the right side. A dialog box will appear that shows the first frame of the video with several settings tabs underneath. Click on the Encoding Profiles tab and from the drop-down list, choose the option named Flash 8 — High Quality 700 kbps. (Figure D)

Figure D

Setting the second Source video to a High Quality setting

Next, click on the Video tab and from the “Quality” pull-down menu on the right, select the option labeled “High” (Figure E). These settings should work fine. Click the “OK” button to close the Settings dialog box.

Figure E

Adjusting the video quality of the second source video

Now you’re ready to process the Queue and convert your source videos to FLV format. Click the Start Queue button on the right and let the Encoder get to work. As the Encoder converts the videos, you will see a preview play in the bottom-right of the screen. (Figure F)

Figure F

Processing the Queue

When the conversion is complete, the videos in the Queue will be marked with a green check mark (Figure G), and the FLV version of your source videos will be in the same directory as their source videos.

Figure G

Both source videos have been converted to FLV format

Now, open the stand-alone FLV player you downloaded earlier and preview your new FLV movie. (Figure H) These FLV files can be used in the creation of your Flash content, or they can be uploaded to any video-sharing site that accepts videos in FLV format.

Figure H

Viewing the new FLV files through the stand-alone FLV player

Read more!

Create a custom Web user interface for Flash video

Adobe Flash’s video technology is all over the Web and is an example of how Internet video has finally arrived after overcoming many technological hurdles during the past decade. (Have you ever been to YouTube.com? You may have heard of it.) The latest version of Flash, CS3, makes it extremely easy to build a custom video player to show off your Flash Video (.FLV) files.

If you have never used Flash before, don’t be intimidated. Building a custom FLV player is largely a matter of dragging and dropping Flash’s Component objects into a document and scripting only a line or two of very simple ActionScript code. In fact, don’t be surprised if you find yourself jumping head first into ActionScript authoring after you see how easy it is.

If you don’t own a copy of Flash CS3, you can download a fully functioning 30-day trial. Also, you’ll be using a royalty-free FLV file to complete the exercise.

Let’s start by opening Flash CS3 and creating a new file. From the File menu, select the New… option. In the dialog box that appears, select the Type: Flash File ActionScript 3.0. This is important; Flash’s video components are more limited if your Flash File is an ActionScript 2.0 type.

Your layout should look like Figure A.

Figure A

The default layout of the Flash CS3 workspace

At the top of the screen, you will see the Layers palette. It is widely considered a good idea among Flash developers that you should keep the objects in your Flash file on a layer that is separate from an empty layer that will hold your ActionScript code. This makes it easier for another developer to look at your file and know where to look to modify the code. It also prevents you (or someone else, for that matter) from accidentally deleting ActionScript code if you need to throw away a layer that contains objects you wish to delete.

At the bottom of the Layers palette, click the New Layer button. Then, rename the top layer “ActionScript” and rename the bottom layer “Objects.” On the ActionScript layer, click the dot under the padlock icon. This will lock the ActionScript layer and prevent you from placing objects on it, as in Figure B. This is also a good time to save your file. Be certain to save it in the same directory as the sample_movie.flv file you downloaded earlier.

Figure B

Arranging and locking layers

Time to build your video player. Select the “objects” layer to make it the active layer, then go up to the Window menu at the top of the screen and select the Components option. The Components palette will appear, as in Figure C. Click the cross to expand the Video Component tree, if you need to.

Figure C

The Components Palette

From the Components palette, click and drag the FLVPlayback component to the stage. A large black box with some controls should now sit on the stage (Figure D).

Figure D

The FLVPlayback component

Flash was kind enough to provide you with a set of controls, but hey… we’re building our own custom video player, here! Let’s get rid of those things. Click on the video component on the stage to select it and then go down to the Properties palette at the bottom of the screen and click on the Parameters tab. In the dialog box that appears, double-click the Skin option to bring up the Skin selector dialog box. From the Skin pull-down menu, select None and click OK to remove the generic controls on our FLVPlayback component (Figure E).

Figure E

Removing the default video controls from the FLVPlayback component

Next, your video component needs an instance name, which will allow ActionScript to call it. With the Video still selected on the stage, click on the Properties tab and in the field labeled , click and type the name “myvideo” (without the quotation marks) and press the Enter key. (Figure F)

Figure F

Giving the FLVPlayback component an instance name

Now we need to tell the FLVPlayback component which FLV file to play. With the video still selected, click on the Parameters tab again and scroll down to the property labeled “source.” Double-click in the empty field to bring up the dialog box that will let you point the FLVPlayback component to the FLV file you downloaded earlier. Be sure to select the Match Source FLV Dimensions check box. Click OK (Figure G). When you return to the stage, you will find that the FLVPlayback component has resized itself to match the size of the sample movie.

Figure G

Setting the Parameters of the FLV component

Now let’s look at the Components palette again. All of the objects under the Video section are components that can be used to control the FLV on the stage. We can use any or all of these to make our custom player, but for now, just click and drag the PlayPauseButton, SeekBar, and VolumeBar components to the stage, directly under the video (Figure H).

Figure H

Dragging the buttons from the Components panel to the stage

Let’s modify these controls a little more. First, select the SeekBar component. Then right-click on the SeekBar and from the pop-up menu that appears, select the Free Transform option. Then hold down the Alt key, click on the right-hand center anchor, and stretch the SeekBar over to the right to make it take up the length of the video up to the VolumeBar (Figure I).

Figure I

Enlarging the SeekBar

Nice, but we can still modify it a bit more. Click on the PausePlayButton to select it and in the Properties panel, go to the Color pull-down menu and select the Tint option. From the color selection menu, choose a nice blue and keep the effect at 50 percent. (Figure J) You could also repeat this step for the VolumeBar and SeekBar and customize their colors as well.

Figure J

Giving the Play/Pause button a different color

Your button components now need instance names — just like the FLVPlayback component — so that ActionScript can call them and link them to the FLV movie. Click on the PlayPauseButton to select it and in the Properties panel, give it an instance name of “playpause.” (Don’t include the quotes.) Repeat this process, giving the instance names of “seekvideo” to the SeekBar component and “volslide” to the VolumeBar component (Figure K).

Figure K

Giving instance names to all of the video control components

Here’s the part where you get write some ActionScript. Go to the top of the screen and in the Layers palette, select the ActionScript layer. Then, go to the Window menu and select the Actions option. A large pane will appear. This is where you will write your ActionScript code (Figure L).

Figure L

The ActionScript layer selected and the open ActionScript Window

Recall that we gave the FLVPlayback component an instance name of myvideo. We’re going to refer to that in our ActionScript code, as well as referring to the instance names of each one of the three control components.

Click in the right-hand (blank) side of the Actions window and type the following three lines of code. Note: Lettercase is important here — type the code exactly as you see it below, or the Control buttons will not work!

myvideo.playPauseButton = playpause;

myvideo.seekBar = seekvideo;

myvideo.volumeBar = volslide;

Your ActionScript code should display in your Actions panel, as shown in Figure M.

Figure M

The completed ActionScript code

Save the file and test your handiwork by going up to the Control menu and selecting the Test Movie option. When the video loads, be sure to play with all of the controls to make sure that they work. (Figure N)

Figure N

Testing the Flash movie

This is a very simple demonstration of the variety and ease of customization that Flash CS3 and ActionScript 3.0 give you over Flash Video content. Experiment with the other video control components — their placement, colors, and sizes — and go wild!

Read more!

Saturday, October 6, 2007

How to Build a community Web space with Drupal

Drupal is listed as an open source content management system. However, I would say that Drupal is more of a community tool that extends itself beyond the standard needs of a community site. It's a typical open source tool in that development is outstanding and seems to go on at an exceptionally fast rate.

What does Drupal do?

Drupal offers the following:

  • Collaborative book: This is one of the more unique features of Drupal. You can set up your site to include "open source" authoring of a book.
  • User-friendly URLs: With the help of Apache's mod_rewrite, Drupal allows the admin to customize URLs on the site, making them easier for both users and search engines.
  • Polls: Both admins and users can create polls.
  • Threaded comments: This refers to the commenting engine within published content (not Forums).
  • Version control: Drupal contains a versioning system that keeps track of updates and edits of content.
  • Modules: The Drupal community has put together a large amount of modules (as of this writing, 2,022).
  • Administration: Drupal has one of the most well thought-out administration tools I've seen in this type of system.
  • Online help: Drupal has a great community-driven help forum. Naturally, it's open source.
  • Cross Platform: Drupal will work under both Apache and IIS environments.
  • Themes: Hundreds of themes currently exist.

The above list just skims the surface of what Drupal offers. With that in mind, let's get to the installation and configuration of your first Drupal site.

Installation

The first thing you will need to do is to get the latest release of Drupal. As of this writing, the latest release is 5.2 and can be downloaded from the Drupal download section. Make sure you download the stable release, not the development release.

Once you have the file on your server, you'll need to create the database the site will use. I use phpMyAdmin to create all databases (it makes MySQL so much easier.) I named my database, simply enough, drupal. You will need to know the following for your database:

  • host (if Drupal is being installed on the same server as the MySQL database -- as it should be -- localhost will suffice).
  • Database username
  • Database password

The next step will be to unpack the Drupal file. I will be installing Drupal on Fedora 7 so I will be unpacking the tar.gz file (inside of the document root /var/www/html/) with the command tar xvzf drupal-5.2.tar.gz. Once the file is unpacked, I changed the name of the resulting directory from drupal-5.2 to drupal with the command mv drupal-5.2 drupal. The final step (before we take over with the browser-based install) will be to modify the permissions of one file within the drupal directory. Issue the command (from within the drupal directory) chmod 777 sites/default/settings.php. This change only needs to occur during the installation of the system.

Once you have the permission set on the file, point your browser to http://address_of_server/drupal/install.php and enter the database information into the first window, as shown in Figure A.

Figure A

Under the advanced options, you can enter a table prefix in case you intend on having more than one Drupal installation using the same database.

Once you have that information, press Save Configuration and you will see the final configuration screen, as shown in Figure B.

Figure B

Take heed of the warning in pink.

Now, as the warning says, you will want to remove write permissions to the ./sites/default/settings.php. Do this with the command chmod 555 sites/default/settings.php (from within the drupal installation directory.) Select the link to continue on to your new site.

You are now ready to start configuring your new Drupal site.

Initial configurations

When you first go to your new Drupal site, you'll notice that the first steps are all laid out for you, as shown in Figure C. The first step is to set up an administrator account.

Figure C

Before you do any other configuration, you must create the administrator account.

It's relatively simple. Select the Create The First Account link. Here you will be asked for a username and e-mail address. Once you enter those two bits of information, you'll be asked to add a password, signature, select the proper time zone, and press Submit. The account is created. Once this account has been created, you will see a new menu entry on the left hand navigation: Administer. Select this link to bring up the administration window, as shown in Figure D.

Figure D

The first thing you should take note of is the pink box.

The pink box will display any installation errors. If there are any (there likely will be), select the status report link within the box. This new window will give you all of the necessary information you need to solve any remaining installation woes. As you can see in Figure E, my installation needs to have a directory created and cron jobs started.

Figure E

Fortunately, the system tells you exactly what you need to do to finish the installation.

The first thing to do is to create the files directory within the drupal installation directory. To do this, issue the command mkdir files from within the drupal directory. Next, issue the command chmod -R 777 files (again, from within the drupal directory). Once you have done that, refresh the status report page to see only one issue (cron jobs) remaining.

To take care of the cron job issue, you can simply select the Run Manually link for a quick fix. Now all errors are taken care of and the site is ready to be finished.

Obviously, your demands will dictate how you configure your site. So I will walk you through enabling modules, configuring blocks, and configuring menus.

Enabling modules

There are a number of modules pre-installed on your system. Not all of these modules are enabled, however. To enable the modules, you will need to select the Administer link from the left navigation and then select on the Modules link under Site Building. Once there -- see Figure F -- you simply have to scroll down the list of modules, check the enable box associated with the desired module, and (when you have checked all the modules you wish to enable) press the Save Configuration button.

Figure F

After base installation, only the bare minimum of modules is enabled.

If you have found modules that are not included with the base installation and you want to include them, you simply have to upload the file to the server in the drupal/modules directory, unpack the module file (either in tar.gz or .zip format), point your browser to the Modules page (the same page you see in Figure F) and check the Enable box for the newly added module.

Make sure the module you want to add is compatible with the Drupal version installed.

Once you have enabled the modules, you will have to add them to a block for them to appear.

Dealing with blocks

A block is simply a module placed within a block on the Drupal page. There are five locations for blocks: Header, Left Sidebar, Right Sidebar, Content, and Footer. Select the Administer link and, under Site Building, select the Blocks link. The new page will list the various modules along with a drop down list of the locations to place their block as seen in Figure G.

Figure G

Select the drop-down list to select where the module will live.

Once you have decided where the module block will go, assign the block weight. Weight gives the block a position ranking within its location. You can choose a weight ranging from -10 to 10. The lower the number, the higher up on the page the block will appear. If you want a particular block on top of the section, simply assign that block the lowest possible number.

Once you have assigned all the necessary blocks, press the Save Configuration button. When the page refreshes, the new modules appear in their blocks. If a module has no content, the block will not appear.

Configuring menus

Go back to the Administer link and select the Menu link under Site Building. The menu items you should be most concerned with are the Navigation items. This is where you can add links to various modules and features to your site. There are two ways to add links under the Navigation menu shown in Figure H. The easiest method is to scroll through the listed items and select either Enable (to add the item) or Disable (to remove the item).

Figure H

Once you enable an item, the Edit link will appear, allowing you to further configure the entry.

You can also manually add various links to the menus. By selecting the Add Item link, you can add a link to either an external site or a page within your site. To add such links, you will be required to enter the full URL to the site or page.

You can also add new menus by selecting the Add Menu link near the top of the Menus configuration. This will only require you create a name for the new menu. Once the menu is created, you can add items as you did with the navigation menu.

Final thoughts

As you can see, Drupal is a very simple system to install. Don't let the installation fool you, however; Drupal is very powerful. You can flex a lot of muscle with this system, but only as much muscle as you want to flex. Now that you have your Drupal site up and running, you can explore just how to make it fit your exact needs.

Read more!