October
9

The Basics of CHMOD

Posted In: *nix, Webmaster by Scott Spear

What is CHMOD?

CHMOD is a Unix shell command, short for change mode, that can change the permissions of a file or directory. CHMOD uses references (or classes), operators, and modes to assign permissions for users to files. CHMOD can be used in a string notation and octal notation, which is represented in numbers instead of a string.

How can I see the permissions?

The Unix File System Permissions are easily viewable by a directory listing, using a command like ls. This listing will show the current file permissions in the string or symbolic notation of 10 characters. The first character displays the file type and the next three sets of three characters represent the file permissions per class (owner, group, others respectively). You can see an example ls listing below:

$ ls -l test
drw-rw----   2 testuser  testuser       96 Dec  8 12:53 testdir
-rw-rw----   2 testuser  testuser       96 Dec  8 12:53 testfile

How can I change the permissions?

You can use CHMOD two different ways (different syntaxes as noted above) to change the permissions. A string notation and octal notation are available, one being a symbolic syntax and the other being a numerical syntax. String notation uses "r", "w", and "x" to change the permissions while octal notation uses 4 for "r", 2 for "w", and 1 for "x". These numbers are added together to get the appropriate permissions (For example: 6 = 4+2 = rw). You can check out a simple CHMOD JavaScript calculator that calculates the octal notation for the permissions you choose. You can also see some example uses of both notations below:

String Notation

chmod u=+rw,go=r testfile - Add read/write to the user, read to group/others
chmod o= testfile         - Remove all permissions for others
chmod -w testfile         - Remove write permissions for all

Octal Notation

chmod 0644 testfile       - Read/write for the user, read for group/others
chmod 0660 testfile       - No permissions for others
chmod 0444 testfile       - No write permissions for all





October
8

.

Installation

FreeBSD provides a very easy installation process; it uses Sysinstall as an automated installation package to do it for you. All you have to do is answer some questions to create users and tell it which software to install and you are on your way to being up and running in a matter of minutes. The full installation takes longer that a few minutes to complete, but using Sysinstall to set the installation parameters is very quick. This installer takes care of everything needed to have FreeBSD installed and functioning correctly on your system, including user creation, software/application installations, network and peripheral setup, and much more.

Security

FreeBSD is one of the most secure operating systems available. There are a number of security features built into the system that deal with user and file system security. There are also a number of applications compatible with FreeBSD that offer added security beyond the default features. Besides the basic user permissions modified through CHMOD, FreeBSD offers the ability to use ACL and MAC. These options allow user permissions on a more specific level than the basic Unix permissions. You can also use a firewall to secure your system. FreeBSD has two options built in, altq and dummynet, as well as a number of applications available for install like IPFILTER (IPF), IPFIREWALL (IPF), and PacketFilter (PF). Another way to secure your system is change the default password hash from md5 to blowfish in login.conf.

Another great security feature that comes with FreeBSD is the ability to jail a process. This allows for separate environments for processes that are completely locked off from others. These jails function as almost a separate installation of FreeBSD allowing for its own user processes, user accounts, and files. Using a jail helps for testing software and often used by web hosts to give their users control over a virtual server.

Compatibility

There are numerous hardware compatibilities listed on the hardware notice for each release of FreeBSD. It is compatible with all the major processors the most popular being Intel and AMD. There are also thousands of applications available for installation on a FreeBSD system. As well as having all of those application ports available, you can run Linux applications on FreeBSD with the Linux Binary Compatibility system. This allows you "to run about 90% of all Linux applications without modification" (Linux Binary Compatibility).

Ports

The port system is a collection of software that is packaged and ready for installation on a FreeBSD system. You can download the source and install them very quickly and easily. Ports are available from the installation disc, online at the ports collection, or at FreshPorts. Once you have chosen a port to install and have followed the installation procedures, you can stay up to date with the ability to download and compile the updates easily from within the ports system. There are currently over 19,000 ports within 63 categories available for download and use (FreshPorts Stats).

Documentation

FreeBSD has many different options for documentation. They offer eight different kinds of documentation on their website including FAQ, Manual Pages, and the FreeBSD Handbook. There is also a web resources section, a for newbies section, and books and articles. The handbook is in my opinion the the best resource available and can be viewed online in multiple formats and downloaded as a local copy. There are a number of books dedicated to FreeBSD as well; a search on Amazon.com will demonstrate this. You won't have to browse the web for basic command questions; you can use the man pages on your installation of FreeBSD so you can have general command help locally whenever needed.





Read Similar Posts


August
11

A traditional web server is made up of many different components, including an http server, mail server, FTP server, and more. In days gone by, a webmaster would install each software package individually to get a custom web server up and running. These kinds of server setups offer many advantages, including testing, learning, and being able to have total control over the web server environment. Today there are many different options available that bundle each component into an easy single installation package.

The installation packages are basically split into two main categories, WAMP (Windows Apache MySQL PHP) servers and LAMP (Linux Apache MySQL PHP) servers. As you can see, they are installation packages that include the Apache httpd server, the MySQL database server, and PHP installed on either a Windows machine or a Linux/Unix machine. There are many different WAMP/LAMP installation packages available that contain the 4 major components, as well as other software to make a more full featured web server. These packages can vary slightly, while meeting the general requirements for running a web server. I have listed some of the most common packages available below.

WAMP

  • Apache2Triad - This package includes an incredible list of features. It installs Apache with mod_python, mod_ssl, mod_perl, OpenSSL, and AWStats, MySQL with phpMyAdmin, PostgreSQL with pgAdmin and phpPgAdmin, xmail with PHPXMail and UebiMiau, SlimFTPD with PHPsFTPd, PHP with Pear and Smarty, Perl with CPAN, and Python with Spyce and wxPython.
  • XAMPP - This package installs Apache with OpenSSL, MySQL with phpMyAdmin, PHP 4 and PHP 5, FileZilla FTP server, and Mercury Mail Transport System. You can also get Perl and Tomcat as an add-on.
  • WampServer 2.0 - This is the new version of the WAMP5 server. It installs Apache, MySQL with PHPMyAdmin and SQLiteManager, and PHP. It doesn't have all the bells and whistles of the first servers listed, but it is reliable and has the ability to install many different releases of Apache, MySQL, and PHP.
  • The Uniform Server - This package installs Apache, MySQL with phpMyAdmin, and PHP. It also includes SSL capabilities, but I couldn't find what software is used.
  • SpikeWAMP - This package installs Apache, MySQL, and PHP. This version also includes the ability to install popular applications like Drupal, Joomla, Moodle, phpBB, and more. There is also an update channel that allows you to download and install the new beta versions of the applications. This is a nice and easy WAMP installation package.

LAMP

  • XAMPP - This package installs Apache with OpenSSL, MySQL with phpMyAdmin, PHP 4 and PHP 5, FileZilla FTP server, and Mercury Mail Transport System.
  • Apache Toolbox - This package installs one of the largest bundles of applications and mods I have seen; it boasts almost 100 different modules. Some of these include Apache, MySQL, Apache, WebDAV, OpenLDAP, and gd libraries. Take a look at the website to get the full listing.
  • BitRock - This package is based on the BitNami stacks and installs Apache, MySQL with phpMyAdmin, and PHP. There are also some popular applications available for easy installation with BitRock, like phpBB, WordPress, Joomla, and Subversion just to name a few.

What LAMP/WAMP server do you use? Or do you set up all the pieces separately? Let us know in the comments.