Wednesday, May 13, 2015

Install Samba to build a File Server

Install and Configure Samba.



  smbclient -L //localhost
1)
  mkdir /sambashare
  chmod 777 /sambashare
  ls -ltr /
  cd /sambashare/
   touch testfile1
   touch testfile2
  useradd lisa

2) 
  yum -y install samba samba-client
 
  cd /etc/samba/
 
  cp smb.conf smb.conf.backup

3)
  vim smb.conf
    workgroup = sambagroup
//copy last section para as it & modify it
        [sambashare]
       comment = my share
       path = /sambashare
       public = yes
       writable = yes
       write list = +users
4)
  service smb start

  service smb status
 
  smbpasswd -a lisa

5) 

  ls -ltr /sambashare/
  
  ls -Zd /sambashare/

6)  setenforce 0

how to test samba work
   smbclient -L //192.168.100.251 -U lisa
 
7) 
  mount  -o username=lisa //192.168.100.251/sambashare/ /mnt
   cd /mnt
   ls

8) access from windows

   \\192.168.100.251

///////////////////////////////////////////////////////////////////

  testparm



//////////////////////////////////////////////////////////////////
  
  [root@mydemovm home]# systemctl stop firewalld
[root@mydemovm home]# systemctl disable firewalld
 



////////////////////////////////////////////////////////////////////

 umount -l /mnt

 mount  -o username=lisa //192.168.100.251/sambashare/ /mnt

 umount -f /mnt

 ls -Zd /sambashare

  smbclient -L //192.168.100.251 -U lisa

 yum install cifs-utils -y

No comments:

Post a Comment