20061009

From Wsms

Jump to: navigation, search

previous next


Go To:Linux Class Notes

Monday Oct 09 2006

Contents

Installing Fedora Core Under Virtual PC by Copying the Virtual Disk

Teacher brought a DVD and all those students who don't have a functional version of redhat now, will get teacher's dvd and install the Redhat in this new way:
  1. From a machine who has the virtual machine installed, make a image on dvd of that VM.
  2. In the new machine, make a directory and copy the dvd. The image is called: my documents\my virtual machines\Fedora core hard copy 1 hard disk
  3. Start_>virtual PC
    1. Wizzard starts ->Next->
    2. Create a Virtual Machine ->next
    3. Name an location ok. -->next
    4. -->next
    5. Adjust ram to 256-->next
    6. Select a existing virtual hard disk-->next
    7. Browse and find the copy we just made-->next
    8. FINISH
  4. We start the virtual machine and it works.

Working with Linux

About the different uses of Linux

Here in this classroom, Linux is a tool available to support backoffice (serverstyle) aplications (most of those will be server applications)
We will use webservers, mostly the "Apache Web server"
We will use it as a DNS (Domain Name Server) -- Bind
We will use it as mail server (mail) -- Sendmail
We are here to learn about webservers

80% or more of typical users, can probably use lynux as a desktop utility... but they do simple things (surfing, word processing, spreadsheets...)
It is possible to the average user use Linux for simple things.
Most of people use computers to play. There are a lot of games for Linux.

The most dificult thing teacher has found to not definitively migrate to Linux, is that he is used to the program Quicken, and there is not that program for Linux.

Problems:
The first marketplace for hardware vendors, is windows.
Other problem is the update method. There are different update technologies to use (this is a problem for homeusers that don't have enough skills to update their O/S).

As experts, we need to have enouth knowledge about multiple operating environmets. A real detrimental for your market ability is to be "inlove" with only one technology

File systems in Linux

Microsoft works with two different file systems: FAT and NTFS
Linux also needs to do with file systems. It recognizes a number of FS.
Lynux recognizes a lot of more FS
The most alike to microsoft FS are the ext2 and ext3
(Extended File system older an newer version). The 3 version does a better job in recovery than ext2.
NFS
(Developed by Sun Microsystems) Network File System
File systems recognized by windows too
Msdos (Windows FAT file system)
VfatMsdos (Windows FAT file system)
Ntfs Msdos (Windows NTFS file system)
proc
Pseudo file system for processes. I can see all of the resoruces of my machine.
iso9660
FS for CDROMS. Is an international standart of the way of formating cds. All OS recognizes this systems.
smfs
To be able to run applications used by the microsoft O/S. This is called the system message blodk file systems and it is compatible with Windows Server Protocol)
One of the weaknesses of Linux is that the three levels of permission for 3 different entities worked great 20 years ago, but today is not a find enough shifting of permission. For example, the writing permission is unchangable. For example, the append feature for files is not built it in unix.

Way of organizing data in a Linux FS

Important Directories

Remember: In windows we have a tree: \: that is the root in windows. Windows, program files, docs and settings, etc: we can expect what to find in each subdirectory

Lynux also uses the hieratical file system:
Things starts at some level (root /) and there are several levels.
/
This is the root
Home
One directory for each user of the system
It's kind of equivalent to documents and settings user1...usern.
bin
This folder contains the comands that are common and available to all users.
etc
The most equivalent to the windows registry. This is the folder that contains the information of the configuration for the O/S. The configuration concept in Linux is very different to that in Windows.
99% of all of the configuration of a unix-based system is done by editing a text file.
boot
Here is where the Linux Kernel goes.
After update cycles you can put different versions of the Kernel in this folder.
Is easier to backup to earlier versions of the kernel, since copies are made all the time.
dev
One entry for each hardware device, that not necesary has to be phisicale installed on the computer.
lost+found
Is a system function. Not used for users
mnt
a folder for each possible mountable device. eg. /mnt/cdrom.
That means is that if I put a CD in my cd drive, its information will be shown as if it was in that folder.
It is like the concept of a drive letter.
root
The root user has a own directory at this level rather that having it under /home.
The word root under Linux means two different things: the root of the file system, and a specific user of the unixspace that is the administrator.
sbin
Standard programs available to the administrative user only. eg. shutdown, ifconfig (to config the IP)
tmp
Temporary file space for programs. It is "world writable". This is a folder that any program that functions in the computer, can write in this folder.
In the past there were a lot of atacks that succeed using this feature. For example an attack called "admrocks".
This folder is got to be managed. It must have known things, and it has to be with an eye kept on it, because it's the favorite for attackers.
usr
Aplications. This is the most equivalent to the program files folder on the windows environment.
var
files that change frequently (i.e. Mail, logs)

References in a Linux file system

There are relative and absolute references

Absolute
When you call the directory since the root symbol (/). Eg: cd /etc
Examples
/home/joem
/etc
/var/log/httpd
Relative
When you call the directory without saying explicitly where it is from the root. Eg cd etc
Examples
home/joem
../mary
httpd/log

Basic things on Linux

Everyone starts the virtual machine, the fedora, and goes to the terminal enviroment.
Loging in as an administrative user is not a good idea.
Several things to understand about loging in in Linux
1. You are conecting to a shell.
Most linux distributions and instalations will have the shell conected by default with BASH, that means Bourne Again Shell.
It defines a lot of commands. IT DEFINES THE OPERATING ENVIRONMENT, the history, how to login, how to write scripts, etc.
There are a lot of other shells. For example for MAC, we have BSD-Unix system, that is the tch shell, different for the Bourne shell.
As you move since one sistem to the other, things cannot run as well in both. In order to know what shell are you running, you type the ps command.

2. There is no concept of recycle bin. There is a very remote posibility to undelete something that has already been destroyed, because this is a multi-user environment.

3.. You are going to issue commands. When you issue commands, youre running executable programs that are probably in a library somewhere, and it is executed. When you run commands, it not really matters what shell are you using. The simplest comands we have is one to look the contents of the directory you are in now.

Basic Commands in Linux

ls
To view the files there are in the directory.
Don't forget that the file system in Unix is case sensitive. It has many implications.
It is also important to remember that is better not to use spaces or special caracters in unix.
It accepts multiple arguments, separated by spaces.
There is a hieracy of things you can see by default using ls:
  1. Contents of our home folder
  2. Objects that are not "hidden"
  3. Color-encoded object.
When explorating a folder, you see different colors:
blue: directories
white: files
aqua: Links
su (switch user)
To give yourself access as a different user.
It asumes by default that you need to be the root user.
If you don't use arguments, it only asks for password, because it thinks you want to be root.
Part of the funcionality of the O/S is to sturtup some terminals, and each terminal starts up a shell. When I run su, it starts a subshell with root privileges.
exit or logout
To get out of the shell.
<EOF> key = <ctrl>+d key does the same and takes the user back to the previous shell or the terminal sesion.
ps
to know how deep have you went into the shell dept.
pwd
Print Working Directory. Tells the user where he is. This is the savior, because the prompt is not very helpful the most of the time.
The special character ~ (tilde) means that the user is in the home directory.
cd (change directory)
To change the folder you are in.
rm (remove)
rm is the delete comand. Be careful with the rm command. It does not move files to a recycle bin like on Windows. It immediately and permanantely deletes them. If you are logged in as a normal user, it is easy to lose all your work. If you are logged in as root, it is easy to destroy everyone's work and even the entire linux install. You might want to look into something like:
alias rm='rm -i'

See also Linux_commands

Personal tools