In part one, David Vasta introduced Linux to the IBM i person. In part two he provided an overview of useful commands and terminology for the novice. Here, he explains how permissions and authorities work.
[IMAGE]
In Linux, file names can be up to 256 characters long with "-", "_", and "." characters and letters and numbers. When a long file listing is done, there are 10 characters that are shown on the left that indicate type and permissions of the file. File permissions are shown according to the following syntax example:
drwxrwxrwx
There are a total of 10 characters in this example, as in all Linux files. The first character indicates the type of file, and the next three indicate read, write, and execute permission for each of the three user types, user, group and other. Since there are three types of permission for three users, there are a total of nine permission bits. The table below shows the syntax
[TABLE]
There are five possible characters in the permission fields. They are:
This can be a bit tricky as we as System i people are not used to this type of security. Everything in Linux is a file much like the System i
The first character is a "d" and is for directory
What is chmod?
chmod is a Unix command that lets you tell the system how much (or little) access it should permit to a file. Using the command will edit the information in the previous section.
CHMOD - Changes the authorities on a file using the command with the proper arguments.
Example: chmod a+rwx myfile
The first character identifies the set of permissions to be changed and can be one of the following:
The next part after the '+' is what we are changing. The + adds and a - removes. The rwx permissions are being added. All of them are being added so all the people accessing this file will have rwx permissions to it. You could also us the octal format. The octal format is a little more geek but once you get it, makes lif
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

e easy. Most admins use this format anyway.
Example: chmod 775 myfile
755 is a little easier for you to nail the permissions home.
R=4
W=2
X=1
You may find this Cut and Paste chmod calculator helpful as you begin working with chmod.
File management concepts
Owner: Every file in Linux has one and only one owner. The owners permissions are controlled with file authority. The owner can change the owner or any of the part of the file authority using the CHOWN command as long as they have root access or some type of sudo or SU.
Group: Every file in Linux has one (and only one) group. User profiles have a primary group that is listed in the /etc/passwd file and they can belong to other groups in the /etc/group file. Files created by a user will get the owners primary group. Group ownership is changed using the chgrp command.
Directory listings: One of the most common commands you will use is "ls." It's a very useful command and has loads and loads of options. Use "man ls" to find them all.
Typical uses for "ls":
[TABLE]
Copying files: The "cp" command is short for "copy." This command gives you the ability to copy files al over the OS as long as you have rights.
cp file1 file2
This command copies file1 into a new file called file2 or: cp <original file> <new file name>
cp can copy the entire contents of a directory: cp -r oldddir newdir
Relocation or renaming files: So you want to move some files around and you need a truck, you should get a "mv" command. Here is what it takes to move files using mv:
mv file1 files2 file3 direcrtory
or
mv oldfilename newfilename
User management: What is a user?
User-name is a representation of a unique User ID (UID) on the
system. Each user is associated with a primary group and can belong to one or more secondary groups.
A user definition typically consists of the following items:
Fields in the /etc/passwd file:
[TABLE]
Fields in the /etc/group file:
[TABLE]
User profile control, configuration files: Linux makes use of "control files" to configure a user's login environment and shell environment (among others). Many of these control files reside in the user's home directory, typically /home/. The names of most of these files starts with a "." which means that they are not displayed in a normal (i.e., "ls" listing). The "-a" option on the "ls" command will display the hidden files.
/home//.profile
Read/invoked when the user log's into the system and contains settings for the overall login environment for the user
/home//.bashrc
Read/invoked every-time a new shell is started and contains settings for the shell environment
/home//.vnc
A directory that contains information required for running vnc sessions. This directory is created the first time the user issues the 'vncserver' command. It is read/invoked every-time the user starts a new vncserver session
Where is the GUI?
At this point you are likely pretty tired of the command line, and I don't blame you. I would be too. Right now there are a few schools of thought on GUI desktops. With hardware becoming more speedy one might ask what does it matter if I run a desktop on my server? While I can see the point, I have to tell you that I disagree, unless you absolutely can't live without them. I'll concede, some of the server-based tools in the GUI are nice. In the same breath, I'll tell you to go ahead and run the server with the GUI because Linux is so fast that it's not going to build up that much overhead anyway. You decide. There are alternatives to running and GUI that I would like to cover also.
Most servers give you the option at some time to install the GUI, and I have found myself wanting the GUI at least for the first few days. While I know the commands I still think at times the GUI is just as quick and can get the same things done.
When push comes to shove you are going to want the command line because it may be the only way to talk to the server. So knowing both is always good. I would build up my command-line skills then work from the GUI. You could alternatively do as I did, and do them both at the same time. I called it cheating at that time, but later chalked it up to the way I learn.
Once you get the X-Windows system up or the GUI you can use a VNC client to access it from your local PC. It's all very easy. I will not be covering how to install X Windows or the GUI.
My favorite tool is Webmin. I found it some weeks after my first Linux Server install, and have been in love ever since. It allows the administrator to run the server from a Web console. It's all rather cool and is really easy to install. Also it will work with most of the Linux and UNIX based operating systems out there right now, so if you have some other boxes, I would highly recommend using Webmin on them as well.
Packages
Redhat and SuSE utilize the RPM or Rehdat Package Manager to install applications. IBM packages most of their applications for Linux in RPM format along with gZIP and TAR as well. Debian and Ubuntu us the .deb packages in case you run across them and wonder what they are, of course this just means confusion for the end user.
Package installation concepts
[TABLE]
That is all for this session. Please remember there are tons and tons of places to get your content online for Linux. If you don't have an answer you need can find it somewhere. A site I like is the The Linux documentation project.
Editor's note: SearchEnterpriseLinux.com has tips and information similar to what you find at Search400.com.
ABOUT THE AUTHOR: David Vasta is the Lotus Notes Administration Team Lead over North America at Atlas Copco. He has 17 years of data center and iSeries experience working in companies such as IBM, REAL and Cingular. He writes a regular blog at System i blogger.