How To Share a Folder Through SAMBA


  • Create a folder to share
# cd /
# mkdir data → folder name

  • Sharing the folder using SAMBA
# nano /etc/samba/smb.conf

** Go to end of file to new line and type following

[my data share] → Share name
path = /data → folder to share
public = yes → any SAMBA user can access the folder
writable = yes → all SAMBA users can write in to the folder

  • Reload the service
# service smb reload

Although we have given writable SAMBA permissions to all SAMBA users want to be able to write in to it from windows . Unless we change ext3 file folder permission.

# cd /
# ls -ld data → folder name
# chmod 757 data → normal way
# ls -ld data

Configuring a Windows File Server (SAMBA Server)



What is SAMBA Server?

Samba is an implementation of a Common Internet File System (CIFS, also known as SMB) protocol server that can be run on almost every variant of Unix in existence.
Microsoft clients will use this protocol to access files and printers located on your Unix
box just as if it were a native Windows server.

Samba is an open source project, just like the Linux kernel (a Unix-like operating system
for PCs). The source code, written in C, is always available to you to explore, test, or
change. And it’s free!

The implication of these items is that Samba is being installed in more and more server
rooms in order to provide file and print services to Microsoft Windows clients without
installing a Windows NT/2000 Server or any other CIFS server.

STEPS
  • Check the RPM - # rpm -q samba
  • Set the SAMBA work group name according to windows work group or domain name
# nano /etc/samba/smb.conf

* press Ctrl+W & find the word mygroup.
* Remove mygroup and type windows work group name or domain name.
* Save & Exit
  • Start the SAMBA Service
# service smb start
# chkconfig smb on

Now you will be able to see the SAMBA Server through My Network Places in windows, but to access the SAMBA server. We have to have windows compatible user accounts in Linux. That is also known as SAMBA user accounts.

* You must have a Linux user accounts.
* The Linux server accounts you can convert to SAMBA.

# smbpasswd -a user1 → (user name)

New Password → Give windows compatible password

Now users can access their Linux Home folder through Windows. Because by default the User's Home Folder will be automatically shared, when we add the user to SAMBA.

Download SAMBA RPM - http://samba.xsec.it/

File / Folder Searching Commands

To locate all data (personal / system data)

# locate objectname

Example: #locate splash.xpm.gz

# locate splash

# find location search parameter object name
# find / -name 'splash.xpm.gz' or # find / -name 'splash*'

To locate system data only

# whereis system file name

Example: #whereis inittab

# which system command name

Example: #which mount

How to Mount Storage Devices in Linux

Mounting a Rom Drive (CD/DVD/CD-RW/DVD-RW)
  • Create a mount point - empty folder to load the data structure of a Storage Device.
# mkdir /media/mycd → (mount point name)
#
ls /media

Mounting
  • Put the CD in to ROM Drive
# mount /dev/cdrom /media/mycd
# cd /media/mycd

# ls -l


To take out the CD (Eject)

# eject
# eject -t


Mounting the FDD
  • Create a mount point
# mkdir /media/myfdd → (mount point name)

Mounting
  • Put the Floppy in to the FDD
# mount /dev/floppy /media/myfdd
# cd /media/myfdd
# ls -l
  • Before you take the floppy out
# unmount /media/myfdd

Mounting a USB Storage Device

Once you fix the USB Drive, It will be automatically detected as a SCSI Storage Device.
Example : dev/sda
  • Create a mount point
# mkdir /media/myusb → (mount point name)
# ls /media
  • Mount
# mount /dev/sda1 /media/myusb
# cd /media/myusb
# ls -l
  • before you unplug the USB Drive
# unmount /media/myusb

Linux Basic Commands


Commands
  1. BASH Commands (Shell Commands)
  2. Application Commands


  • sbin → System Binary
  • bin → Binary
* To see shell commands, type (help)
** ¦ more → fit the output to screen
Ex: help
¦ more

* To see Shell and Application Commands.
** Login as root and press Tab key Three times.

* How to check commands (Is it Shell or Application command)
** type -a command name
Ex: type -a logout

* How to see details of commands (Shell Description)
** whatis command name
Ex: whatis cal

Long Description
man command name Ex: man cal


Directory Browsing and listing Commands

■ To see the current location of a user
  • Command → pwd (Print Working Directory)
■ To see the contents of current folder
  • Command → ls or tree
■ object color codes (files and folders)
  • White text base files
  • Dark blue folders
  • Green executable file (or any file to copied from Windows to Linux)
  • Purple multimedia files
  • Orange device driver files
  • Red → compressed files
  • Light Blue → short cuts
Object Rename

command → mv
Syntax → mv_current_object name_new object name

Ex: mv folder1 folder2

Moving Objects

command → mv
Syntax
→ mv_object name_new location name
Ex: mv folder1 /home

Deleting Objects

command → rm
Syntax
→ rm_-r_object name
Ex: rm -r folder

CentOS Installing

About CentOS ( Community Enterprise O/S )

The CentOS Project
The CentOS Project is the name of the Organization that produces CentOS. They are not a part of any other organization.

Step - 1



The installation procedure is typical RedHat, simple and straightforward. Boot your computer from the CentOS 5 CD 1 or DVD and press Enter on the CentOS 5 boot up screen. This will install CentOS 5 in graphical mode.

Step - 2



Choose Skip in the CD Found window. This will skip the CD media test. If you click on the OK, You will have the option to check the media for defects and errors before installing. Not a bad idea, in general.

Step - 3



After a short time, the installation will begin. Click Next to go forward.

Step - 4



Choose a language and click Next.

Step - 5



Choose a keyboard Layout for the system and click Next.

Step - 6



This Step you must do carefully. Click Next and answer Yes on the Warning window.

Minimum Partitions for installing Linux
  • Swap Partition - to improve performance of the O/S (Virtual Memory)
  • Root Partition (/) - to keep the boot files and Linux kernel, to install the O/S, to install application software, to keep personal data.
Creating Minimum Partitions
»» Creating a SWAP partition
- No Mount Point

New → Select SWAP as a file system → Select partition Size

If your RAM in the PC less than 2GB, give the SWAP 2 times of your RAM capacity (Ex: 512MB RAM → 512 × 2 = 1GB)

Since we are only going to create minimum partitions. We can give the rest of the Hard Disk Drive space to the root partition.

»» Create Root partition
- / (root) mount point

New → select / (root) as a mount point → select ext3 as file system type → select partition size



This is the final result

Step - 7



Select automatically via DHCP
( you can configure network settings later)

Step - 8



Choose a region in the map. If the system clock is set to your local time.

Step - 9



Specify a strong password at least six characters long. Click Next when you done.

Step - 10



Select packages what you want to install.

Step - 11



Click Next to begin installation.

Step - 12



Congratulations, the installation is complete. Remove the CD and click Reboot to proceed to configuration.