Friday, January 31, 2014

How to configure Samba Server on Red Hat Enterprise Linux 5


Samba server:

The Samba server is the preferred tool to install a LAN (Local Area Network) working with the SMB protocol (Server Message Block). It is therefore possible to mix efficiently in the same network Linux and Windows PC with knowledge of the server software.
Its usefulness: SAMBA is a system for sharing files and printers between Linux and Windows in a transparent and stable.
 Red Hat Linux can become a Samba server by installing the Samba rpm package either through the command line or the GNORPM tool. The next step is to edit the /etc/smb.conf file after copying it to a file with the .bak extension. It takes a bit of trial and error to come up with a good configuration that works. The testparms command can be used to check for errors in the /etc/smb.conf file. Make sure that the server is restarted after every configuration change using the /etc/rc.d/init.d/smb restart command. To avoid any permission problems, make sure that an smb password file is created using the smbpasswd command. Linuxconf and webmin can also be used to configure the Samba server using a nicely formatted GUI or web-based interface. SWAT is a web-based Samba configuration tool which can also be accessed inside webmin.

Installing & Configuring a Samba Server:

The default configuration file (/etc/samba/smb.conf) allows users to view their Red Hat Linux home directories as a Samba share. It also shares any printers configured for the Red Hat Linux system as Samba shared printers. In other words, you can attach a printer to your Red Hat Linux system and print to it from the Windows machines on your network.
Command Line Configuration:

Open terminal and type these commends to install samba server packages from yum server.
[root@localhost ~]# yum install samba*
[root@localhost ~]# service smb restart
Shutting down SMB services:                                 [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                           [  OK  ]
Starting NMB services:                                          [  OK  ]

[root@localhost ~]# chkconfig smb on

 Samba uses /etc/samba/smb.conf as its configuration file. If you change this configuration file, the changes do not take effect until you restart the Samba daemon with the command service smb restart. To specify the Windows workgroup and a brief description of the Samba server, edit the following lines in your smb.conf file:

[root@localhost ~]# vi /etc/samba/samba.conf   -->(vi cmd opens the file)

(edit the following lines in the file by pressing key 'i') 

   workgroup = MYGROUP
   server string = Samba Server Version %v

;       netbios name = MYSERVER

;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
        hosts allow = 127. 192.168.1. 192.168.188.     

 (edit here the n/w ID you desired to share samba server)

(in the end of the file u will find these lines edit them or copy them and past them down to these and then edit them as shown below)


# A publicly accessible directory, but read only, except for people in
# the "staff" group
;       [public]
;       comment = Public Stuff
;       path = /home/samba
;       public = yes
;       writable = yes
;       printable = no
;       write list = +staff

(edit in this way as per your requirements)

        [shared]
        comment = shared
        path = /shared
        public = yes
        writable = yes
        printable = yes
        browseable=yes
        write list = +staff
:wq!

[root@localhost ~]# service smb restart
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

[root@localhost ~]# chkconfig smb on

[root@localhost ~]# testparm

(cmd shows details of samba server shared directory)

Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[shared]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = MYGROUP
        server string = Samba Server Version %v
        security = SERVER
        passdb backend = tdbsam
        idmap uid = 16777216-33554431
        idmap gid = 16777216-33554431
        hosts allow = 127., 192.168.1., 192.168.188.
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No

[shared]
        comment = shared
        path = /shared
        write list = +staff
        read only = No
        guest ok = Yes
        printable = Yes


[root@localhost ~]# useradd ravi
[root@localhost ~]# passwd ravi
Changing password for user ravi.
New UNIX password:                    (type here the desired password)
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:        (again type here the desired password)
passwd: all authentication tokens updated successfully.
[root@localhost ~]# smbpasswd -a ravi        (samba login ID)
New SMB password:                                         (type samba ID’s password)
Retype new SMB password:
Added user munna.
[root@localhost ~]# smbclient //192.168.1.15/shared -U ravi
Password:
[root@localhost ~]# chcon -R -t samba_shared_t /shared
[root@localhost ~]# setsebool -P samba_enable_home_dirs=1 -->(cmd to solve selinux error

Samba server configuration has finish.
 

How to Configure yum server on Red Hat Enterprise Linux 5



 Yellow dog Updater, Modified (YUM) server:

Yum is the easiest way to keep all programs up to date. It downloads and installs the latest version of a program. A single command can update all software installed, including third-party software, security updates and operating system. For this we install yum and make it to do all the above.
Yum works in a safe, standardized way. It uses rpm (Red Hat package manager) for installing programs. Authenticity of packages is checked with strong gpg encryption. Package repositories are just folders on a yum server (your local machine) or web server.

Configuring yum server: To configure yum server we need to insert the RHEL5 DVD or cd into the DVD-ROM of your machine and open the gnome-terminal to type these commands. 

[root@localhost ~]# cd /media/RHEL_5.1\ i386\ DVD/Server/
[root@localhost Server]# rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm
warning: createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@localhost Server]# rpm -ivh vsftpd-2.0.5-10.el5.i386.rpm
warning: vsftpd-2.0.5-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]
[root@localhost Server]# cd
[root@localhost ~]# cp -rv /media/RHEL_5.1\ i386\ DVD/Server/ /var/ftp/pub/server
[root@localhost ~]# cp -rv /media/RHEL_5.1\ i386\ DVD/VT/   /var/ftp/pub/
[root@localhost ~]# vi /etc/yum.repos.d/server.repo/   -->(this cmd opens file)
                  ******************
(press key 'i'to edit the following lines in the file)

[server]
name=server.repo
baseurl=file:///var/ftp/pub/server
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 (press Esc)
:wq!   
(to save & exit from file)

[root@localhost ~]# service yum-updatesd restart
Stopping yum-updatesd:                                     [  OK  ]
Starting yum-updatesd:                                     [  OK  ]
[root@localhost ~]# yum clean all  -->(cmd checks if any errors in configuration of yum server & cleans all cache memory)
[root@localhost ~]# yum install (package name)* -->(cmd to install pkg through yum server)

Hence you have configured yum serve successfully, now you can install any package you desired with a single commend.

Thursday, January 30, 2014

How to Install windows XP professional



Important Information
Before the install/reinstallation of Windows XP, I highly recommend that you download Service Pack 3 “for multiple computers” and burn it onto a CD. The download is approximately 316.4MB. If you choose not to do this step, your system could become infected with a virus or worm exploiting the vulnerabilities that Service Pack 3 fixes. I also recommend that you do NOT have your system connected to the Internet until after the installation of Service Pack 3. This means that you cannot activate your XP installation during setup, but you can accomplish that task following a reboot after Service Pack 3 is installed.
1) Windows Setup
After configuring the system for booting from a CD, the Windows Setup screen appears.
At this point, Setup is loading the driver files it needs to continue with installation.

2) Welcome to Setup:
The “Welcome to Setup” screen appears with the option of Continuing Setup, Repair a previous installation, or Quitting.
Press ENTER to Continue Setup.
You may also choose R to Repair, or F3 to Quit and reboot the system.

3) Windows XP Licensing Agreement:
The “Windows XP Licensing Agreement” screen, otherwise known as “EULA,” displays the legal in’s and out’s of this particular software package.
You may press F8 to signify that you agree with the terms, hit ESC if you do not agree and PAGE UP or PAGE DOWN to scroll through each screen. Note: If you do not agree to the terms, setup will quit and reboot the system.

4) Hard drive partition information:
Hard drive partition information is now displayed. This varies with each systems hardware configuration.
This example already has a partition defined. I will choose not to use this and create a new one by pressing D.
You may skip this and the next few steps if you do not have any partitions defined.
At this point, the options include pressing ENTER to install on the selected partition, D to Delete the selected partition, or F3 to Quit and reboot the system.

5) Warning screen:
After pressing D to delete the selected partition, a warning screen appears explaining the pitfalls of deleting it. This particular screen only appears when the partition selected to be deleted is formatted as a bootable system partition. Other partitions will display the next screen.
I want this to happen, so I press ENTER to continue.
The options include pressing ENTER to continue, or ESC to Cancel.

6) Confirmation screen:
A confirmation screen that displays the logical drive, what file system the partition is currently using, the size in MB and controller information.
Options include L to Delete the partition and ESC to Cancel the action.

7) No partitions have been previously defined:
If no partitions have been previously defined, this screen will be displayed. You may section your hard drive in as many partitions as you wish by selecting C to Create a Partition and then entering in a value less than the total available. Here, I will create a Partition in the highlighted, unused portion.
Select the partition you wish to install to using the UP arrow and DOWN ARROW keys.
Press ENTER to use the highlighted partition and Install, C to Create a Partition, or F3 to Quit and reboot the system.

8) Enter in the partition size:
Enter in the partition size in MB within the displayed minimum and maximum. I chose the default or maximum available here.
You may choose ENTER to Create the new partition or ESC to Cancel the action.

9) Continue to create partitions:
Continue to create partitions until all space is used or the configuration meets your requirements.
Note: a small portion will be unavailable to partition. This is normal. In this example, it is 2 MB.
I chose drive C: or Partition1 to install the Operating System.
You may choose ENTER to Install to the selected partition, D to Delete the highlighted Partition, or F3 to Quit and reboot the system.


10) Format the partition:
Since this OS supports NTFS, format the partition with it. If you do not, many folder and file security features will be unavailable. Note: If you are dual booting your system, a previous OS will not be able to read the local information. This is a fact with Windows 9x and Me. If you have a requirement to view this partition from another OS installed on the system, do not format it as NTFS. Also, the boot partition must be formatted with FAT32 if you wish to dual boot. I have found no problems accessing a NTFS partition mapped as a network drive from an older OS.
Select what format you wish to use by pressing the UP ARROW and DOWN ARROW keys.
Press ENTER to confirm your selection and Continue or ESC to Cancel.

11) Setup formats the partition:
Watch the progress bar as Setup formats the partition, or get up and get a soda. It may take awhile.


12) Creating File List:
Setup is now figuring out what files to copy over to the hard drive.

13) Setup copies various files:
After the partition is finished formatting, Setup copies various files to support booting from the hard drive and continue on.

14) Creates various information files:
Setup then creates various information files required to continue on with setup.


15) Press ENTER to Restart:
The first reboot and the end of the blue background has arrived. If you are impatient, press ENTER to Restart before the 15 seconds expire.
ENTER to Restart the Computer is the only option available.


16) Windows XP boot screen:
The new Windows XP boot screen is displayed.


17) Windows XP Installation:
If you have installed Windows before, this type of screen will look familiar.
Sit back. It may be awhile.


18) Faster and more reliable:
Every Windows OS that comes out has the same claim. Faster and better. It is subject to debate whether or not it could get “any worse.”


19) Region and Input Languages:
A little while later, you will be prompted with options of configuring your Region and Input Languages. The default was fine for me, so I selected Next.
Options include Customize button, Details Button, plus the standard Back and Next.

For Next Step please Download this File