Wednesday, December 24, 2014

Dtrace on the Solaris Non-Global Zone

List solaris privileges in global-zone:

# ppriv -l “zone-name”

List of non-global zone privileges:

# zlogin “zone-name”

# ppriv -l “zone-name”  ( use -v for more verbose info)

How to use Dtrace

# zonecfg -z “zone-name”

zonecfg:zone-name> set limitpriv="default,dtrace_proc,dtrace_user"

zonecfg:zone-name> exit

Now boot the zone:

# zoneadm -z “zone-name” boot

Now log in:

# zlogin “zone-name”

Run Dtrace utility:

# dtrace -l

Trick:

You can run the commands on the fly the same way you execute
the commands over SSH on the local zone from the global


# zlogin “zone-name” svcs -a | grep -i ssh



====================================

Solaris 10 zone Admin commands in short

List the zones:

# zoneadm list -iv

Reboot the zone:

# zoneadm -z “zone-name” reboot

Halt the zone:

# zoneadm -z “zone-name” halt

Uninstall a zone:

# zoneadm -z “zone-name” uninstall -F

Cloning a non-global zone on the same system:

from the global zone as a root-

# zoneadm -z “zone-name” halt

you can configure new zone by exporting the configuration
of the zone you are using as a source. Edit the pfile as
the configuration can not be same for components
like network resources

# zonecfg -z “zone-name” export -f /export/zones/pfile

Install the new zone and clone it:

# zoneadm -z “zone-name” clone

List the zones on the global zone:

# zoneadm list -cv


====================================

Deleting/Removing non-global zone:


Shutdown the zone from global zone:

# zoneadm “zone-name” shutdown -y -g0 -i0

Remove root file system for the zone:

# zoneadm -z “zone-name” uninstall -F

Now delete the configuration:

# zoneadm -z “zone-name” delete -F

Let's list the zones:

# zoneadm list -cv

====================================

How to Login - non-global zone:

If the zone is just installed, you are required to login
the zone so that the configuration can be completed. I would-
call it kind of a post installation configuration.

From global zone:

# zlogin -C “zone-name”

Note: the zone is always in the "unconfigured" state after the
      installation is done.

-C option is for console login equivalent of serial console login.

Login as a regular user:

# zlogin -l username “zone-name”

In case of failed login and further trouleshoot- Please use the
failsafe mode:


# zlogin -S “zone-name”

Friday, May 9, 2014

SSH passwordless login: Solaris 10

root@solaris01: / $ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (//.ssh/id_dsa):
Created directory '//.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in //.ssh/id_dsa.
Your public key has been saved in //.ssh/id_dsa.pub.
The key fingerprint is:
1d:c6:10:63:39:db:2c:69:8a:cc:c4:ae:75:15:74:b6 root@solaris02
root@solaris02: / $ ll
total 981

root@solaris01: .ssh $ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBANZP8v0o/NFHt+1Tu3BISCnKoJ4SqonlAZcTm25sT1zbrmCSjv1WDa54/fuRDmqsavIymj+HmGAK1pNmh8ThuKTqznGpA+6BW7tJXG6EIB1+5iZPMkIhRJzDIvWycGumG/BjKvCdLus3rtKaV6ShAmYUZhsFHetepGfWFdQhr7i9AAAAFQCPqVyVY4XjhzaK2KkRSl1r3IjDkQAAAIBLSn4I6BR2SOqYIH3WL2herepkTr5f3y+hzLjpI91S6MEcj9XljjAg9M8TQPPMImWlKnOl/2A3JGeeH79fUVUeLIBobDJ2wyJZyiDdFPhkCpGGfwHaNhc+a81YutgiVXMS5VmmSmmFgAAAIAUQT27kUeBa4hrbYaHAdzeAACNjlf5ODXBcsmuJTaEW2D2sroeJ1pfsEiL/BhJlpX99NT6HsuxYM4GO1zutFv3TX97YMrKJRa2Yxy5cRlGLoStmTRhktyXDbdHpWALsutMyocFIkLZTte0e1fL9zMWNbCg2qzl+oiUFyw9o9tX+A== root@solaris01

on solaris02 host:

chmod go-w /.ssh

paste this key in the autorized_keys on solaris02 

save the file and initiate the passwordless login

root@solaris01: / $ ssh solaris02
Last login: Fri May  9 18:09:24 2014 from solaris01
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
root@solaris02: / $

thats it.


change hostname in solaris 10 after fresh install.

1. backup the /etc/hosts and /etc/hostname.interface files.
2. add the hostname entry in the /etc/hosts file.
3. mv the old /etc/hostname.interface to /etc/new_hostname.interface
4. on the command line hostname hostname
 exit from the terminal and login back. You should see the new hostname now.

Change the PS1 value for the login prompt:

PS1="\u@\h: \W $ "

Crontab in solaris 10

A little different in solaris 10 while editing the cron job.

You will have to export the vi editor and then edit the crontab file.

   #  EDITOR=vi
   # export EDITOR
   # crontab -e

#ident  "@(#)root       1.21    04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
0 22 21,10 * * "Testing crontab" > /dev/console

 wq! and the save the file

-bash-3.2# crontab -l
#ident  "@(#)root       1.21    04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
0 22 21,10 * * "Testing crontab" > /dev/console

thats it.




Friday, April 25, 2014

changing time-zone on SUSE-11 Enterprise

Here are the quick steps:

Backup the /etc/localtime just in case....rest of the steps are straight forward.
test-suse11:~ # rm /etc/localtime
rm: remove regular file `/etc/localtime'? y
test-suse11:~ # ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
test-suse11:~ # date
Fri Apr 25 15:41:38 PDT 2014
test-suse11:~ # hwclock
Fri Apr 25 22:45:21 2014  -1.042860 seconds
test-suse11:~ # hwclock -w
test-suse11:~ # hwclock
Fri Apr 25 15:41:59 2014  -1.044826 seconds

Thursday, March 27, 2014

Samba on RHEL-6 with Windows 7


[user1@rhel-6 ~]$ su - root
Password:
[root@rhel-6 ~]# service smb status
smbd is stopped

[root@rhel-6 ~]# service smb start
Starting SMB services:
                                   [  OK  ]
[root@rhel-6 ~]# service smb status
smbd (pid  62320) is running...

[root@rhel-6 ~]# ps -aef | grep smb
root     62320     1  1 16:07 ?        00:00:00 smbd
root     62323 62320  3 16:07 ?        00:00:00 smbd
root     62334 62284  0 16:07 pts/1    00:00:00 grep smb

[root@rhel-6 ~]# cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig

[root@rhel-6 ~]# ls -la /etc/samba/smb.*
-rw-r--r-- 1 root root 11464 Jan 23  2013 /etc/samba/smb.conf
-rw-r--r-- 1 root root 11464 Aug 14  2013 /etc/samba/smb.conf.bak
-rw-r--r-- 1 root root 11464 Jan 23  2013 /etc/samba/smb.conf.orig
-rw-r--r-- 1 root root 10031 Aug 13  2013 /etc/samba/smb.conf.rpmsave

[root@rhel-6 ~]# vi /etc/samba/smb.conf

In the [global] section set the workgroup parameter:
 workgroup = RA-DEMO
 add the following to the end of the file then save it:
[samba-demo]
 comment = RHEL6-Windows Demo Share
 path=/samba-demo
 writeable = yes
 browseable = yes
 valid users = samba-user


  groupadd -g 1234 samba-users
  adduser -d /samba-demo -m -u 1234 -g 1234 -c "Samba demo user accnt" \
  adduser -d /samba-demo -m -u 1234 -g 1234 -c "Samba demo user accnt" samba-user
  ls -ld /samba-demo
  echo "This file was placed in the /samba-demo file share area on the RHEL6 server. > /samba-demo/This_is_the_RHEL6_server
  echo "This file was placed in the /samba-demo file share area on the RHEL6 server" > /samba-demo/This_is_the_RHEL6_server
  chown samba-user:samba-users /samba-demo/This_is_the_RHEL6_server
  ls -ld /samba-demo
  ls -l /samba-demo

[root@rhel-6 ~]# groupadd -g 1234 samba-users

[root@rhel-6 ~]# adduser -d /samba-demo -m -u 1234 -g 1234 -c "Samba demo user accnt" samba-user

[root@rhel-6 ~]# ls -ld /samba-demo
drwx------ 4 samba-user samba-users 4096 Mar 25 16:10 /samba-demo

[root@rhel-6 ~]# echo .This file was placed in the /samba-demo file share area on the
.This file was placed in the /samba-demo file share area on the

[root@rhel-6 ~]# echo "This file was placed in the /samba-demo file share area on the RHEL6 server" > /samba-demo/This_is_the_RHEL6_server

[root@rhel-6 ~]# chown samba-user:samba-users /samba-demo/This_is_the_RHEL6_server

[root@rhel-6 ~]# ls -ld /samba-demo
drwx------ 4 samba-user samba-users 4096 Mar 25 16:11 /samba-demo

[root@rhel-6 ~]# ls -l /samba-demo
total 4
-rw-r--r-- 1 samba-user samba-users 76 Mar 25 16:11 This_is_the_RHEL6_server

[root@rhel-6 ~]# smbpasswd -a samba-user
New SMB password:
Retype new SMB password:
Added user samba-user.

[root@rhel-6 ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[samba-demo]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = RA-DEMO
        server string = Samba Server Version %v
        log file = /var/log/samba/log.%m
        max log size = 50
        idmap config * : backend = tdb
        cups options = raw

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

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

[samba-demo]
        comment = RHEL6-Windows Demo Share
        path = /samba-demo
        valid users = samba-user
        read only = No

[root@rhel-6 ~]# service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
[root@rhel-6 ~]# service smb status
smbd (pid  62398) is running...
[root@rhel-6 ~]# chkconfig smb on
[root@rhel-6 ~]# chkconfig --list smb
smb             0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@rhel-6 ~]# smbclient -L RHEL6-srv -U samba-user
Enter samba-user's password:
Connection to RHEL6-srv failed (Error NT_STATUS_UNSUCCESSFUL)
[root@rhel-6 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0D:9E:C1
          inet addr:142.88.100.106  Bcast:144.77.109.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0d:9ec1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4375060 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1329280 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1372746393 (1.2 GiB)  TX bytes:1005914980 (959.3 MiB)

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:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)

[root@rhel-6 ~]# smbclient -L 142.88.100.106 -U samba-user
Enter samba-user's password:
Domain=[RA-DEMO] OS=[Unix] Server=[Samba 4.0.0rc4]

        Sharename       Type      Comment
        ---------       ----      -------
        samba-demo      Disk      RHEL6-Windows Demo Share
        IPC$            IPC       IPC Service (Samba Server Version 4.0.0rc4)
        Microsoft_XPS_Document_Writer_(from_XP0007)_in_session_225_(redirected_1):27 Printer   PDFCreator (redirected 1)
        Microsoft_XPS_Document_Writer:3 Printer   Microsoft XPS Document Writer
        Microsoft_XPS_Document_Writer_(from_BOA0007D)_in_session_6_(redirected_1):24 Printer   HP Deskjet F4400 series (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Fax:4           Printer   Fax
        HP_LaserJet_P4014.P4015_PCL6:8 Printer   HP LaserJet P4014/P4015 PCL6
        PDFCreator_(redirected_1):14 Printer   Microsoft XPS Document Writer (from PHNT-NAN227) in session 25 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_TjLWE1WS44HyRnVxQ)_in_session_10_(redirected_1):26 Printer   RightFax Fax Printer (redirected 1)
        Microsoft_XPS_Document_Writer_from_rgraber_(redirected_1):28 Printer   sutterec_gbutler (redirected 1)
        VMP001P2\Laser396:5 Printer   \\VMP001P2\Laser396
        Client.NEE-E0391945$Microsoft_XPS_Document_Writer_(redirected_1):10 Printer   Nitro PDF Creator (Pro 8) (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(redirected_1):11 Printer   Client/US-AC63906#/Microsoft XPS Document Writer (redirected 1)
        RightFax_Fax_Printer:2 Printer   RightFax Fax Printer
        Foxit_Reader_PDF_Printer:7 Printer   Foxit Reader PDF Printer
        Microsoft_XPS_Document_Writer_(from_WI_Y6oeiaFFxtABLEAHd)_in_session_1_(redirected_1):20 Printer   RightFax Fax Printer (redirected 1)
        Microsoft_XPS_Document_Writer_(from_SAP_ALL-D046154)_in_session_30_(redirected_1):25 Printer   Microsoft XPS Document Writer (redirected 1)
        Microsoft_XPS_Document_Writer_(from_TXUCORP-JYIB)_in_session_6_(redirected_1):16 Printer   Microsoft XPS Document Writer (from TXUCORP-JYIB) in session 6 (redirected 1)
        Send_To_OneNote_2010_(redirected_1):13 Printer   Microsoft XPS Document Writer (from JNBWKS77) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_s67pKbyniVmHYkqSX)_in_session_5_(redirected_1):19 Printer   Microsoft XPS Document Writer (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_mvaQVbkPEQoCAn_VP)_in_session_2_(redirected_1):18 Printer   Microsoft XPS Document Writer [ICA-tcp#9445] (redirected 1)
        Microsoft_XPS_Document_Writer_from_cfritz_(redirected_1):23 Printer   Send To OneNote 2010 (redirected 1)
        RightFax_Fax_Printer_(redirected_1):12 Printer   Microsoft XPS Document Writer (from CZC81527W0) in session 19 (redirected 1)
        VMP001P2\Laser369_Color:6 Printer   \\VMP001P2\Laser369_Color
        Microsoft_XPS_Document_Writer_from_bkuhns_(redirected_1):22 Printer   Microsoft XPS Document Writer (redirected 1)
        Send_To_OneNote_2010:1 Printer   Send To OneNote 2010
        Microsoft_XPS_Document_Writer_(from_WRG239113)_in_session_4_(redirected_1):21 Printer   PDFCreator (redirected 1)
        Microsoft_XPS_Document_Writer_(from_W0_R_T0OwPjsoCfOio4J)_in_session_8_(redirected_1):29 Printer   Send To OneNote 2010 (redirected 1)
        Microsoft_XPS_Document_Writer_(ICA-tcp$9445)_(redirected_1):15 Printer   Microsoft XPS Document Writer (from TXUCORP-CFK8) in session 8 (redirected 1)
        VMP001P2\Laser356:9 Printer   \\VMP001P2\Laser356
        Microsoft_XPS_Document_Writer_(from_UNN-HSHS3)_in_session_10_(redirected_1):17 Printer   Microsoft XPS Document Writer (from WRG239113) in session 4 (redirected 1)
        samba-user      Disk      Home Directories
Domain=[RA-DEMO] OS=[Unix] Server=[Samba 4.0.0rc4]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
[root@rhel-6 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0D:9E:C1
          inet addr:142.88.100.106  Bcast:144.77.109.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0d:9ec1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4375461 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1329329 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1372812844 (1.2 GiB)  TX bytes:1005924674 (959.3 MiB)

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:57 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:14929 (14.5 KiB)  TX bytes:14929 (14.5 KiB)


[root@rhel-6 ~]# smbclient -L //142.88.100.106/samba-demo -U samba-user
Enter samba-user's password:
Domain=[RA-DEMO] OS=[Unix] Server=[Samba 4.0.0rc4]

        Sharename       Type      Comment
        ---------       ----      -------
        samba-demo      Disk      RHEL6-Windows Demo Share
        IPC$            IPC       IPC Service (Samba Server Version 4.0.0rc4)
        Microsoft_XPS_Document_Writer_(from_XP0007)_in_session_225_(redirected_1):27 Printer   PDFCreator (redirected 1)
        Microsoft_XPS_Document_Writer:3 Printer   Microsoft XPS Document Writer
        Microsoft_XPS_Document_Writer_(from_BOA0007D)_in_session_6_(redirected_1):24 Printer   HP Deskjet F4400 series (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Fax:4           Printer   Fax
        HP_LaserJet_P4014.P4015_PCL6:8 Printer   HP LaserJet P4014/P4015 PCL6
        PDFCreator_(redirected_1):14 Printer   Microsoft XPS Document Writer (from PHNT-NAN227) in session 25 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_TjLWE1WS44HyRnVxQ)_in_session_10_(redirected_1):26 Printer   RightFax Fax Printer (redirected 1)
        Microsoft_XPS_Document_Writer_from_rgraber_(redirected_1):28 Printer   sutterec_gbutler (redirected 1)
        VMP001P2\Laser396:5 Printer   \\VMP001P2\Laser396
        Client.NEE-E0391945$Microsoft_XPS_Document_Writer_(redirected_1):10 Printer   Nitro PDF Creator (Pro 8) (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(redirected_1):11 Printer   Client/US-AC63906#/Microsoft XPS Document Writer (redirected 1)
        RightFax_Fax_Printer:2 Printer   RightFax Fax Printer
        Foxit_Reader_PDF_Printer:7 Printer   Foxit Reader PDF Printer
        Microsoft_XPS_Document_Writer_(from_WI_Y6oeiaFFxtABLEAHd)_in_session_1_(redirected_1):20 Printer   RightFax Fax Printer (redirected 1)
        Microsoft_XPS_Document_Writer_(from_SAP_ALL-D046154)_in_session_30_(redirected_1):25 Printer   Microsoft XPS Document Writer (redirected 1)
        Microsoft_XPS_Document_Writer_(from_TXUCORP-JYIB)_in_session_6_(redirected_1):16 Printer   Microsoft XPS Document Writer (from TXUCORP-JYIB) in session 6 (redirected 1)
        Send_To_OneNote_2010_(redirected_1):13 Printer   Microsoft XPS Document Writer (from JNBWKS77) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_s67pKbyniVmHYkqSX)_in_session_5_(redirected_1):19 Printer   Microsoft XPS Document Writer (from W0_Nm0Qhounsvj4sran-) in session 9 (redirected 1)
        Microsoft_XPS_Document_Writer_(from_WI_mvaQVbkPEQoCAn_VP)_in_session_2_(redirected_1):18 Printer   Microsoft XPS Document Writer [ICA-tcp#9445] (redirected 1)
        Microsoft_XPS_Document_Writer_from_cfritz_(redirected_1):23 Printer   Send To OneNote 2010 (redirected 1)
        RightFax_Fax_Printer_(redirected_1):12 Printer   Microsoft XPS Document Writer (from CZC81527W0) in session 19 (redirected 1)
        VMP001P2\Laser369_Color:6 Printer   \\VMP001P2\Laser369_Color
        Microsoft_XPS_Document_Writer_from_bkuhns_(redirected_1):22 Printer   Microsoft XPS Document Writer (redirected 1)
        Send_To_OneNote_2010:1 Printer   Send To OneNote 2010
        Microsoft_XPS_Document_Writer_(from_WRG239113)_in_session_4_(redirected_1):21 Printer   PDFCreator (redirected 1)
        Microsoft_XPS_Document_Writer_(from_W0_R_T0OwPjsoCfOio4J)_in_session_8_(redirected_1):29 Printer   Send To OneNote 2010 (redirected 1)
        Microsoft_XPS_Document_Writer_(ICA-tcp$9445)_(redirected_1):15 Printer   Microsoft XPS Document Writer (from TXUCORP-CFK8) in session 8 (redirected 1)
        VMP001P2\Laser356:9 Printer   \\VMP001P2\Laser356
        Microsoft_XPS_Document_Writer_(from_UNN-HSHS3)_in_session_10_(redirected_1):17 Printer   Microsoft XPS Document Writer (from WRG239113) in session 4 (redirected 1)
        samba-user      Disk      Home Directories
Domain=[RA-DEMO] OS=[Unix] Server=[Samba 4.0.0rc4]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

Lastly to access from Windows 7 i.e. to map:

Apply the following rules to the /etc/sysconfig/iptables firewall

restart the iptables

service iptables restart

-A INPUT -p tcp -m state --state NEW -m tcp --dport 137 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 138 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 139 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 445 -j ACCEPT


[root@rhel-6 ~]# smbclient  //142.88.100.106/samba-demo -U samba-user
Enter samba-user's password:
Domain=[RA-DEMO] OS=[Unix] Server=[Samba 4.0.0rc4]
smb: \> ls
  .                                   D        0  Tue Mar 25 16:11:28 2014
  ..                                 DR        0  Tue Mar 25 16:10:09 2014
  This_is_the_RHEL6_server            A       85  Tue Mar 25 16:35:08 2014
  .mozilla                           DH        0  Mon May 20 05:32:55 2013
  .bash_profile                       H      176  Wed Aug 29 04:19:40 2012
  .gnome2                            DH        0  Wed Jul 14 08:55:40 2010
  .bashrc                             H      124  Wed Aug 29 04:19:40 2012
  .bash_logout                        H       18  Wed Aug 29 04:19:40 2012
  Axway_-_Axway_SecureTransport on vmware.pdf      A    85952  Thu Jul 18 09:42:30 2013

                52008 blocks of size 524288. 17385 blocks available
smb: \>

Now map the drive for samba share: see the screen shot: