My primary concern in learning Linux Red Hat is that I wish to
implement and configure the Linux Web Server in the Internet and
Intranet environment. I've ever read some topics on the Windows
NT Web Server that is called IIS4.0 and was impressed very much
at those wonderful functions they have. Also I want to learn
the various kinds of network components came with Linux by
comparing them to the ones of NT. There are a lot of stuffs I
really would like to master, such as nfs, configuring Linux as a
router and proxy server, IP masquerading, and the amazing stuff
of Samba !!! Let's keep going.....
Written by
Gary Goh........July 2000¡¡
¡¡
** Partitions :
/dev/hdb3 ----the 3rd primary partition on the 2nd IDE hard
drive
/dev/sdc6 ----the 2nd logical partition on the 3rd SCSI hard
drive
--> The numbers 1,2,3, and 4 denote Primary partitions. The
Logical Partition starts at 5.
To Make Boot(install) disk on DOS or Windows ;
cd\dosutils
d:\dosutils\RAWRITE (enter)
d:\images\boot.img insert a formatted disk in a drive
(enter)
¡¡
- Each partition is mounted at boot time. The mount process
makes the contents of that partition available as if it were
just another directory on the system. All partitions, when
mounted, appear as a unified directory tree rather than separate
drives.
- Linux keeps its list of users in the
/etc/passwd file(,which also contains all the passwords
for each user in an encrypted format). Each system has its own
copy of this file and a user listed in one
/etc/passwd file can not log in to another system unless
the user has an entry in the other
/etc/passwd file. To enable users to log in to any
system in a network of computers, Linux uses the
NIS (Network Information System ;
formerly known as Yellow Page) to
handle the remote password file issues.
* Shadow password are a
mechanism by which the actual encrypted password entry is not
kept in the /etc/paaswd file but, rather, in a
/etc/shadow file. The /etc/passwd
file remains readable by any user in the system, but /etc/shadow
is readable by the root user only. Good step up in a security.
* X-Windows is the basis for Linux's graphical user
interface. It is what communicates with the actual video
hardware. Programs, such as KDE and GNOME, use X-Windows as a
standard mechanism for communicating with the hardware.
¡¡
** Files and Commands
- Using CAT to create and add to Files
CAT stands for "concatenate" meaning to add to the end of, or
to connect and link in a series.
> is known as redirection of standard
output. "Capture the information that normally goes to the
screen, create a file, and put the information into it"
>> is known as appending standard output.
"Capture the information that would normally go to the screen
and append the information to an existing file. If the file
doesn't exist, create it."
< is used to tell the computer "Take the
information from the specified file and feed it to standard
input, acting as though the information is coming from the
keyboard."
Use the >> symbol to add data to the end of a files
cat file1 file2 file3 file4 >
fileout : joins file1, file2, file3, and file4, putting the
results in fileout.
sort files1 >> file2 : the
sort command sorts the contents of files1 and appends (>>) it to
a (perhaps already existing) file2. If file2 doesn't exist, the
system creates file2 and then puts the sorted output into it.
pwd : Print Working Directory
mv afile bfile : This leaves the afile in
the current directory, but changes its name to bfile. (file was
not really moved, but just renamed)
mv afile ../bbdir : This tells Linux to go
up one directory level and look for a directory called bbdir,
and then put the file into that directory with the the name
afile. (file really moved)
mv afile ../bbdir/bfile : The afile would
have been moved to the bbdir directory with the name bfile (file
moved and renamed)
mkdir bbdir : This creates a new directory
called bbdir.
rmdir bbdir : To remove the bbdir, the
directory must be empty.
rm -rf bbdir : This removes the bbdir
directory and all files and directories under it.
Relative filenames specify the location of files
relative to where you are.(Ex: ls -la ../../etc/passwd)
Filenames that are valid from anywhere in the file system are
called absolute filenames. (Ex : ls -la /etc/passwd)
¡¡
¡¡
** Permissions
1. R (read) for a FILE : read
the file
R for a DIRECTORY : list
the names of the files in the directory ; ls
(R), ls -l (RX)
2. W (write) for a FILE : modify
the file
W for a DIRECTORY : create
or delete files inside the directory
3. X (execute) for a FILE : type and
execute the file ;
(files containing executable Linux commands, called 'shell
scripts' must have both R and X permission by the person
executing them. Programs written in a compiled language
such as C, however, must have only executable permissions, to
protect them from being copied where they shouldn't be copied.)
X for a DIRECTORY : change
the directory with cd command
(Unless you also have R permission for the directory, ls
-l will not work ; ls (R), ls -l
(RX)
ugo rwx (User or Owner, Group, Other Read, Write, eXecute)
Example of changing permissions ; chmod u=r
g=rw o=rwx filename
¡¡
** File System Management
The command syntax for manually mounting a file system ;
mount block-special-file mount-point
* block-special-file is the device driver file for
the partition of the disk drive (such as a hard drive or a
CD-ROM) where you have made a file system.
* mount-point is the directory where the file
system is mounted.
* An Example : To assign the 1st floppy drive, /dev/fd0, to the
/mnt directory.......
----> mount /dev/fd0 /mnt
The directory where the file system will be mounted
(mount-point) must exist before you issue the mount command.
The command syntax for unmounting
umount name
* the name is either the name of the
block-special-file (/dev/fd0) or the name of the directory that
is the mount-point (/mnt).
Mounting all file systems manually everytime you boot the
system would quickly become annoying. To avoid this, you can
have the system execute the required mount commands when you
boot.
The information needed to execute the required mount commands is
in the standard Linux file system configuration file located at
/etc/fstab. The entries in the file
usually follow this format ;
block-special-file mount-loc type opts dump-freq passnumber
EX : /dev/hdb1 / ext2 default
1 1
After you set up the /etc/fstab
configuration file, file system can be mounted automatically at
boot time. And, you can update the file with a program called
linuxconf.
¡¡
** IP Masquerade
* Router --> using invalid IP -> IP Masquerading : For
Private Network
--> using valid IP -> No need IP Masq. -> Firewall
: For Security
* Proxy Server
*** The Firewall package is called IP Chains
!! ***
*** Chains is if, then, else structure !! ***
*** IP Masquerading is a form of NAT (Network Address
Translation) !!***
* To set up a Linux computer as a dedicated router with one
3.5" floppy disk, visit
http://www.psychosis.com/linux-router
¡¡
The Process of Configuring IP Masquerading ;
** IP Masquerading Linux server
(1) Open the netcfg window by typing netcfg&
(2) Click Routing tab
(3) Type ppp0 in the Default Gateway Device and click to
select the Network Packet Forwarding (IPv4)
To verify the above configuration (1)~(3), check and see the
network script in /etc/sysconfig/network, which should be
similiar as below ;
NETWORK = yes
FORWARD_IPv4 = yes
HOSTNAME = rh
DOMAINNAME = win2000.local
GATEWAY =
GATEWAYDEV = ppp0
(4) Run the following commands at shell ;
-> /sbin/ipchains -A forward -j MASQ -s 169.254.0.0/16 -d
0.0.0.0/0
-> /sbin/ipchains -P forward DENY
(5) Run /etc/rc.d/init.d/network restart
You may put the above 2 ipchains commands in
/etc/rc.d/rc.local so that IP Masquerading can be effective
at next boot.
** Check Points at IP Masquerading Client computers (Windows9x
,NT, w2k) ;
(1) IP address should be assigned communicable with IP
masq. server computer
(2) Default Gate Way should point at the IP address of IP
masq. server computer.
(3) DNS should be configured correctly, like set it the
same IP of DNS shown in IP masq. server.
¡¡
** nfs (Network File System)
** The format of the /etc/exports file is ;
Directory Host(Options) # Comments
ex : /dosmnt/w98 *.win2000.local #export local file available
in win2000 domain
* The format of Host names in /etc/exports is ;
network address slash sunet or domain name
ex : 169.254.0.0/255.255.0.0
192.168.18.0/255.255.255.0
*.win2000.local
*pro.win2000.local
???.win2000.local (3 letter hostnames in win2000.local
domain)
* Run the exportfs command after you change the
/etc/exports file
-> /usr/sbin/exportfs -a -v
(-a ; all directories listed in /etc/exports whould be
exported immediately)
(-v ; print verbose output)
* /etc/hosts -------- ip address : host name mapping list
* /etc/host.conf ---- name resolution order
* /etc/resolv.conf --- list of name servers
Stop, Start, Restart programs ---> /etc/ec.d/init.d/nfs
restart
/etc/rc.d/init.d/smb restart (./smb restart)
** RPM (/mnt/cdrom/RedHat/RPMS)
rpm -q samba (query)
rpm -qa (query all)
rpm -e samba (uninstall)
rpm -ivh samba (install/verify/hash)
¡¡
** VMWare and Wine
* VMWare ; running guest operating system (Windows)
under host operating system (Linux) ; must have copies of the
guest o/s and any desired application on the hard drive of your
Linux system (http://www.vmware.com)
* Wine ; running MS-Dos and Windows application under
Linux ; need not have a copy of MS-Dos or Windows on the hard
drive of Linux system
¡¡
¡¡
 |