Wednesday 8 February 2012

samba server configuration in rhel5 step by step

Samba configuration in Linux Machines

Samba is a suite of utilities that allows your Linux Machines to share files and other resources.
such as printers with Windows Machines.

Before configuring Samba server in Linux you need to have the following Pre-requests.

1. Linux System with network Configured

Here i was configured My IP as 192.168.10.111

2. Windows System with network configured in Same network.
   here my System is having  192.168.10.108
  
3.Your Linux System firewall should be disabled.

Main Configuration:

1. Check your linux system wheather the samba package is installed or not with the following command.

[root@localhost ~]# rpm -qa samba*


2. If the packages are not installed in your system, use the following command to install from the internet.

[root@localhost ~]# yum install samba*
Note: Above command is for installing the packages from the internet only. So you should have the internet connection.

3. After installing the Packages
   Make sure that xinetd and Portmap service should be run.
   For checking those services are running or not, use the following commands.
  
   [root@localhost ~]# /etc/init.d/xinetd status

   [root@localhost ~]# /etc/init.d/portmap status

For starting the above service use the following services use the following commands.
  
   [root@localhost ~]# /etc/init.d/xinetd restart
  
   [root@localhost ~]# /etc/init.d/portmap restart


    After that Make sure that these services to be run completely. For that use the following commands.
  
   [root@localhost ~]# chkconfig xinetd on
  
   [root@localhost ~]# chkconfig portmap on
    Check the services is running or not. These services should be running condition.

4. Create 2 users in your linux System i.e: sri and Gani

   [root@localhost ~]# useradd sri
   [root@localhost ~]# passwd sri
   Changing password for user sri.
   New password:
   Retype new password:
   passwd: all authentication tokens updated successfully.

   [root@localhost ~]# useradd Gani
   [root@localhost ~]# passwd Gani
   Changing password for user Gani.
   New password:
   Retype new password:
   passwd: all authentication tokens updated successfully.

5. Now create the share directory. i.e which directory you want to share.
   Here iam creating directory called 'Sambashare' in the following Path. i.e /opt
   and give the full Permissions to the directory.

   [root@localhost ~]# mkdir /opt/sambashare/
   [root@localhost ~]# chmod 777 /opt/sambashare/
   [root@localhost ~]# ls -l /opt/
   total 360
   drwx------. 2 root root  16384 Feb  1 11:01 lost+found
   drwxrwxrwx  3 root root   4096 Feb  6 18:12 sambashare
   -rwxrwxrwx. 1 root root 344558 Jan 30 15:41 sysstat-10.0.3-1.i586.rpm


6. Now enter the configuration into following file. i.e /etc/samba/smb.conf
   In the above file enter the following configuration. Here iam giving permission to one user only.
Add the configuration at end of the file.
  
   Note: Better to take the backup of the configuration file.

   [root@localhost ~]# vi /etc/samba/smb.conf
  
   # My Sharing directory
   [data]
       comment = personal share
       path    = /opt/sambashare
       public  = no
       writable = yes
       printable = no
       browseable = yes
       write list = sri
  
     :wq!
    
     Use these to save the configuration file
     
      :wq!


7. Now add the user to the samba user's List
 
  [root@localhost ~]# smbpasswd -a sri
   New SMB password:
   Retype new SMB password:
   Added user sri.
   [root@localhost ~]#


8. Now we did the all the configurations. so start the samba service and check its status.

   [root@localhost ~]# chkconfig smb on
   [root@localhost ~]# /etc/init.d/smb restart
   Shutting down SMB services:                                [  OK  ]
   Starting SMB services:                                     [  OK  ]
   [root@localhost ~]# /etc/init.d/smb status
   smbd (pid  3686) is running...


Client side configuration for Samba server.

1. Check from your windows System to samba server whether Ping command is working or not.
  
   Start--> run--> cmd --> Ping 192.168.10.111
  
   If you are getting ping with proper reply then your server is working fine or else check the network connectivity
   and Linux System firewall.


2. Now access your samba server in the following way.
  
   Start --> Run --> \\192.168.10.111 -->Press enter. (Here IP address is your samba server IP address)

3. It is asking for samba user's username and password.


4. This is your samba server Main Screen.


5. Now you can Copy or Paste your data.

  
Now enjoy Data transfer through Linux and Windows easily.......

Thursday 12 January 2012

Installing Red Hat Enterprise linux 5 step by step

                   For installing Red hat Linux Enterprise Edition 5, Do the following Steps
Step 1: Turn on the system and insert the First CD, then you will get the following Screen.



Step 2:  From the above Screen, For installing in Graphical Mode Press Enter.  Here i am installing in graphical mode. After Pressing the Enter key you will get the next screen.




Step 3: After Searching the Device drivers and all other things it will display the Media Check Prompt.
If you want to check whether the your Media is working Properly or Not. If you don't want to check the media Click on Skip or else Ok.



Step 4: After the Media Check you will get the following Screen.

     
Step 5: In the above screen Click the Next, Then you will get the Installation Language Scree will appear.
Select the appropriate Language and Click the Next.



Step 6: Now you will get the Keyboard language, Select the required Keyboard language and click the Next.






Step 7: After clicking the Next you will get the License Key Prompt. If you have the License key enter the key in the below field. If you don't have the license click on Skip.

Step 8: Now it will give a waring Are you sure want to Skip the License? Again click on the Skip button, then you will get the Hard Disk partitions Screen.





Step 9:  In the above screen, it will shows the default settings. i.e It will remove all partitions in system and Creates the default file systems. So now i am going with default Settings only. If you want to make Customize File systems select the Customize File systems from the drop down menu and click on Next.
Here you will the following screen.






Step 10: In the above Screen it will gives a warning message that You have chosen to remove all the partitions. Are you sure you want to do this? Click on yes and you will get the Network Screen.


Step 11: In the above window i am going with default DHCP. I will configure my network later. So click on Next, then you will get the time zone window.



Step 12: Select the appropriate time zone and Click on Next, then you will get the root Password screen.




Step 13: Enter the root Password and Conform the Password again and click on Next. Now you will get the Package Installer window.




Step 14: From the above window if you want to customize the Packages select the Customize now or else select  Customize later and Click on Next.
                                                 You will get the following windows.






Step 15: In the above Screen if click on Next the Installation will Begins or else if you want to change anything click on Back.




Step 16:  In the above window It will warn you that Keep the 3 CD's or else Click on Reboot.  So i am going click on Continue to continue the installation. Now you will get the following Screens.




 Step 17: In the above Screen it asking for Insert CD 2. So insert the 2nd CD and Click on OK. It will automatically continue the installation.




Step 18: After installation it will display the following Prompt. i.e Again asking the CD 3. So insert CD 3 and click on OK. 




Step 19: After Completing the complete installation. It will display the following screen. 


Step 20: In the above screen it shows the remove the media from the CD-Rom and click on Reboot.


Step 21: After the Restarting the system it will display following Screen.

Step 22: In the above screen click on Forward then you will get the License Agreement window. In that accept the License agreement and Click on Forward then you will get following Screen.


Step 23: Keep the firewall enabled and give the exceptions which service you want and click on Forward. Now you will get Date and Time settings. Select the Date and Time, click the Forward.


Step 24: Now you will get the setup for software Updater. Select i prefer to register later and Click on Forward. 




Step 25: Now you got the User creation window. So enter the following fields and click on forward.


Step 26: After the user creation you will get the following Screen about sound card in your system and click on forward.




Step 27: After the above screen you will get the final window. i.e Finish wizard. In this wizard if you want install any Packages insert the CD's and install the packages Or else click Finish.


Step 28: Now you are in Login Prompt. So enter the appropriate user you have created or else login by using root user.


 So finally you have successfully installed the Red Hat Linux Enterprise Edition 5.



Enjoy the Linux with High Security and Reliability........

Thursday 3 November 2011

Configuration of FTP Server in LINUX

Ftp server is designed for uploading and downloading the files, when ftp server users log's in, they get their home folder at client side and if public/anonymous user log's in they get data stored in /var/ftp folder

Steps to Configure FTP Server in LINUX

Step:--1.  Check and install required Packages

Check the packages are installed or not by rpm/yum command

[root@server ~]# rpm -q vsftpd

Remove the packages and old data if required

[root@server ~]# yum remove vsftpd* -y

Install the Packages

Note: Here my file is at Desktop. So i was changing the path to Desktop.

[root@server ~]# cd /root/Desktop/
[root@server Desktop]# ls

FileZilla3  tomcat  vsftpd-2.0.5-10.el5.i386.rpm

[root@server Desktop]# chmod 777 vsftpd-2.0.5-10.el5.i386.rpm

[root@server Desktop]# 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%]

Step:--2. Create the resources on ftp server (file/folder & Users)

   Create users and assign passwords to whom you want to allow logging through ftp
  
   [root@server ~]# useradd tom
   [root@server ~]# useradd joy
   [root@server ~]# passwd tom
   Changing password for user tom.
   New UNIX password:
   BAD PASSWORD: it is too simplistic/systematic
   Retype new UNIX password:
   passwd: all authentication tokens updated successfully.
   [root@server ~]# passwd joy
   Changing password for user joy.
   New UNIX password:
   BAD PASSWORD: it is too simplistic/systematic
   Retype new UNIX password:
   passwd: all authentication tokens updated successfully.
   [root@server ~]#

Create or Copy some files inside /var/ftp/pub folder

[root@server ~]# cd /var/ftp/pub/
[root@server pub]# touch fa.txt fb.txt music.mp3
[root@server pub]# ls
fa.txt  fb.txt  music.mp3


Create a Upload folder for anonymous users and give full permission for read/write.

For example LINUX N UNIX HELP UPLOADS

[root@server pub]# mkdir /var/ftp/linux n unix help uploads
[root@server pub]# chmod 777 /var/ftp/linux n unix help uploads
[root@server pub]#


Step:--3. Edit the Main Configuration file /etc/vsftpd/vsftpd.conf

[root@server ~]# vi /etc/vsftpd/vsftpd.conf

  12 anonymous_enable=YES
 
  15 local_enable=YES

  27 anon_upload_enable=YES

  83 ftpd_banner=Welcome to LINUX N UNIX HELP

 
  :wq!
 
 
Step:--  4. To block the ftp server users (for Ex:-- joy) write the user name in file
 
  /etc/vsftpd/ftpusers
 
  [root@server ~]# vi /etc/vsftpd/ftpusers


# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
joy
~
~
~
~
~
~
~
:wq!


Step:--5. start th ftp service


[root@server ~]# vi /etc/vsftpd/ftpusers
[root@server ~]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@server ~]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@server ~]#



Note:--- Your system Firewall should be turnoff or In firewall settings ftp exception should be added.

For Checking your ftp in Client Machine, Do the following steps:

1.Open the Web Browser and give following URL

ftp://192.168.10.121/

Here replace your ftp server IP address.

To upload or Any changes use any Ftp Software like Winscp or Filzilla , etc....


Wednesday 2 November 2011

Network Configurations in Linux

Assigning a static IP address --- temporarily

Syntax:--

[root@server ~]# ifconfig <devicename> <IP address>

Example:-- To Assign the static IP address as 192.168.10.121

[root@server ~]# ifconfig eth0 192.168.10.121

To check the IP assigned

[root@server ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:08:02:F7:33:6A
          inet addr:192.168.10.121  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::208:2ff:fef7:336a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:773 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:77098 (75.2 KiB)  TX bytes:23592 (23.0 KiB)
          Interrupt:177

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1670 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1670 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3349244 (3.1 MiB)  TX bytes:3349244 (3.1 MiB)

Set Permanent IP address

Do the following Steps:

1. Go to the following Path

    [root@server ~]# cd /etc/sysconfig/network-scripts/

2. After that edit the following file

   [root@server network-scripts]# vi ifcfg-eth0
  
# Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet
DEVICE=eth0
HWADDR=00:08:02:f7:33:6a
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.10.121
GATEWAY=192.168.10.254
TYPE=Ethernet
~
~
:wq!

3. After this restart the network service to activate the new IP address.

To see the LAN card i.e NIC card Parameters


[root@server ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: yes

To enable IP address

[root@server ~]# ifup eth0

To disable IP address

[root@server ~]# ifdown eth0


This is a file where IP address are stored.

[root@server ~]# cd /etc/sysconfig/network-scripts/
[root@server network-scripts]# cat ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet
DEVICE=eth0
HWADDR=00:08:02:f7:33:6a
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.10.121
GATEWAY=192.168.10.254
TYPE=Ethernet

Tuesday 1 November 2011

Networking in LINUX

Introduction to Networking in Linux

To check the system hostname

[root@localhost ~]# hostname
localhost.localdomain

Assigning the hostname - temporarly

Syntax:-

[root@localhost ~]# hostname <computer>

EX:- To assign the hostname as server.linuxnunixhelp.com

[root@localhost ~]# hostname server.linuxnunixhelp.com

To check the hostname assigned

[root@localhost ~]# hostname
server.linuxnunixhelp.com

Assigning hostname ---- Permanently

Edit the configuration file /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=server.linuxnunixhelp.com




:wq!

System Process Commands in Linux

TO check the Process id of any application, command etc

[root@localhost ~]# ps -aux

To kill a process normally


[root@localhost ~]# kill <process_id>

ex: -- [root@localhost ~]# kill 2521

To kill the process forcefully use stamp value as '9'
[root@localhost ~]# kill -9 <process_id>

[root@localhost ~]# kill -9 2521

To see the cpu & process status
[root@localhost ~]# top

To see the open port number and service name

[root@localhost ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      1802/hpiod
tcp        0      0 0.0.0.0:969                 0.0.0.0:*                   LISTEN      1635/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1606/portmap
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1819/cupsd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1854/sendmail: acce
tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      1807/python
tcp        0      0 :::22                       :::*                        LISTEN      1833/sshd
tcp        0    148 ::ffff:192.168.10.120:22    ::ffff:192.168.10.114:1401  ESTABLISHED 2411/1


To view how long the system is running

[root@localhost ~]# uptime
 23:34:45 up 23 min,  2 users,  load average: 0.00, 0.02, 0.08

To view Process, Resource and File Systems

[root@localhost ~]# gnome-system-monitor &


To dump the traffic on the network

[root@localhost ~]# tcpdump -i eth0


To display or change Ethernet card settings
[root@localhost ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1

To Recover Root Password in Linux

1. Restart the PC while restarting press any key to get Grub Screen
2. Press 'e'
3. Select kernal /vmlinuz-2.6.18.-8.el5 ro root=LABEL=/ rhgb quiet
4. Again Press 'e' to edit
5. Edit kernal /vmlinuz-2.6.18.-8.el5 ro root=/ rhgb quiet line and erase quite and type single
6. Press enter
7. Press b to boot
8. At shell prompt type the commands

sh-3.00# passwd
Changing Password for user root
New UNIX Password:123456
Retype new UNIX Password: 123456
Passwd: all authentication tokens updated Successfully.

Now type the following command to Restart the system to the normal Login

sh-3.00# init 6

Usage of chkconfig command

To view the status of the the services in all runlevels
 

[root@localhost ~]# chkconfig --list

To view the status of the Particular services.
For example Bluetooth



[root@localhost ~]# chkconfig --list bluetooth
bluetooth       0:off   1:off   2:off   3:off   4:off   5:off   6:off

To put the service at all runlevel as on

[root@localhost ~]# chkconfig bluetooth on

To view the status

[root@localhost ~]# chkconfig --list bluetooth
bluetooth       0:off   1:off   2:on    3:on    4:on    5:on    6:off

To put the service at all runlevel as off


[root@localhost ~]# chkconfig bluetooth off

To view the status

[root@localhost ~]# chkconfig --list bluetooth
bluetooth       0:off   1:off   2:off   3:off   4:off   5:off   6:off


To manually stop the service

[root@localhost ~]# service bluetooth stop
Stopping Bluetooth services:                               [  OK  ]

To Manually start the service

[root@localhost ~]# service bluetooth start
Starting Bluetooth services:                               [  OK  ]


To Manually restart the service

[root@localhost ~]# service bluetooth restart
Stopping Bluetooth services:                               [  OK  ]
Starting Bluetooth services:                               [  OK  ]


Monday 31 October 2011

Boot Process in Linux

To View the default runlevel while booting the Linux Operating System
[root@tsmservertest ~]# vi /etc/inittab

id:5:initdefault:  (End of the line in Fedora OS)

Note: It means that OS by default always boot to GUI mode.


To View the current runlevel

[root@tsmservertest ~]# runlevel
N 5


To Switch to another runlevel and check the runlevl
[root@tsmservertest ~]# init 3
[root@tsmservertest ~]# runlevel
5 3

[root@tsmservertest ~]# init 2
[root@tsmservertest ~]# runlevel
3 2


[root@tsmservertest ~]# init 1
[root@tsmservertest ~]# runlevel
1 S


[root@tsmservertest ~]# init 6


To View the grup configuration file


[root@localhost ~]# cat /boot/grub/grub.conf

Saturday 22 October 2011

Backup and Recovery

Create a folder
for EX:-- /myfolder

[root@tsmservertest ~]# mkdir /myfolder
[root@tsmservertest ~]# cd /myfolder/

Now create Some files and folders inside it.

[root@tsmservertest myfolder]# mkdir dir1
[root@tsmservertest myfolder]# touch 1 songs tom_file
[root@tsmservertest myfolder]# ls
1  dir1  songs  tom_file


Use the tar command to tape archive the folder

[root@tsmservertest ~]# tar -cvf /opt/myfolder.tar /myfolder
tar: Removing leading `/' from member names
/myfolder/
/myfolder/tom_file
/myfolder/dir1/
/myfolder/songs
/myfolder/1

[root@tsmservertest ~]# cd /opt/
[root@tsmservertest opt]# ls -l
total 12
-rw-r--r-- 1 root root 10240 Oct 22 13:01 myfolder.tar


To Create a tar file with zip

[root@tsmservertest opt]# cd
[root@tsmservertest ~]# tar -cvzf /opt/myfolder.tar.gz /myfolder/
#########OUTPUT#############
tar: Removing leading `/' from member names
/myfolder/
/myfolder/tom_file
/myfolder/dir1/
/myfolder/songs
/myfolder/1
[root@tsmservertest ~]# cd /opt/
[root@tsmservertest opt]# ls -l
total 16
-rw-r--r-- 1 root root 10240 Oct 22 13:01 myfolder.tar
-rw-r--r-- 1 root root   194 Oct 22 13:10 myfolder.tar.gz


To View the contents of the tar file without extracting

[root@tsmservertest opt]# tar -tvzf /opt/myfolder.tar.gz
drwxr-xr-x root/root         0 2011-10-22 12:58 myfolder/
-rw-r--r-- root/root         0 2011-10-22 12:58 myfolder/tom_file
drwxr-xr-x root/root         0 2011-10-22 12:58 myfolder/dir1/
-rw-r--r-- root/root         0 2011-10-22 12:58 myfolder/songs
-rw-r--r-- root/root         0 2011-10-22 12:58 myfolder/1

To remove the folder

[root@tsmservertest ~]# rm -r /myfolder/
rm: descend into directory `/myfolder'? y
rm: remove regular empty file `/myfolder/tom_file'? y
rm: remove directory `/myfolder/dir1'? y
rm: remove regular empty file `/myfolder/songs'? y
rm: remove regular empty file `/myfolder/1'? y
rm: remove directory `/myfolder'? y
[root@tsmservertest ~]# cd /


To extract the tar file or recovery the data


[root@tsmservertest /]# tar -xvzf /opt/myfolder.tar.gz
myfolder/
myfolder/tom_file
myfolder/dir1/
myfolder/songs
myfolder/1


After extracting see the contents inside the folder


[root@tsmservertest /]# ls /myfolder/
1  dir1  songs  tom_file




 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews