Friday 13 April 2012

samba server configuration(CIFS) in rhel6

[root@station1 ~]# yum groupinstall "CIFS file server"
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
server                                                                                                             3596/3596
Setting up Group Process
Resolving Dependencies
--> Running transaction check
---> Package samba.x86_64 0:3.5.10-114.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                   Arch                       Version                               Repository                  Size
=============================================================================================================================
Installing:
 samba                     x86_64                     3.5.10-114.el6                        server                     5.0 M

Transaction Summary
=============================================================================================================================
Install       1 Package(s)

Total download size: 5.0 M
Installed size: 17 M
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
 Userid : Red Hat, Inc. (release key 2) <security@redhat.com>
 Package: redhat-release-server-6Server-6.2.0.3.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
 Userid : Red Hat, Inc. (auxiliary key) <security@redhat.com>
 Package: redhat-release-server-6Server-6.2.0.3.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201111171049.x86_64/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : samba-3.5.10-114.el6.x86_64                                                                               1/1
Installed products updated.

Installed:
  samba.x86_64 0:3.5.10-114.el6                                                                                             

Complete!
[root@station1 ~]# chkconfig smb on
[root@station1 ~]# chkconfig nmb on
[root@station1 ~]# vim /etc/samba/smb.conf
 74         workgroup = WORKGROUP
 80         hosts allow = 10.65.62.
289         [public]
290         comment = Public Stuff
291         path = /home/samba
292         public = yes
293         writable = yes
294         printable = no
295         browseable = yes
296         valid users = ranjith
[root@station1 ~]# mkdir /home/samba
[root@station1 ~]# chmod -R 777 /home/samba/
[root@station1 ~]# smbpasswd -a ranjith
New SMB password:
Retype new SMB password:
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0
Added user ranjith.
[root@station1 ~]# smbpasswd -e ranjith
Enabled user ranjith.
[root@station1 ~]# service smb restart
Shutting down SMB services:                                [FAILED]
Starting SMB services:                                     [  OK  ]
[root@station1 ~]# service nmb restart
Shutting down NMB services:                                [FAILED]
Starting NMB services:                                     [  OK  ]
[root@station1 ~]# smbclient -L //10.65.62.30 -U ranjith
Enter ranjith's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-114.el6]

    Sharename       Type      Comment
    ---------       ----      -------
    public          Disk      Public Stuff
    IPC$            IPC       IPC Service (Samba Server Version 3.5.10-114.el6)
    ranjith         Disk      Home Directories
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.5.10-114.el6]

    Server               Comment
    ---------            -------
    STATION1             Samba Server Version 3.5.10-114.el6

    Workgroup            Master
    ---------            -------
    WORKGROUP            STATION1

After this go to windows pc start->run->\\your samba server ip

No comments:

Post a Comment