Samba install and settings

  # yum install samba  

 

[root@owl43 public]# vi /etc/samba/smb.conf

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

[global]

workgroup = WORKGROUP

server string = OWL45

log file = /var/log/samba/%m.log

security = user

passdb backend = tdbsam

#encrypt passwords = yes

#smb passwd file = /etc/samba/smbpasswd

hosts allow = 127. 192.168.0.

#socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[homes]

comment = Home Directories

browseable = no

writable = yes

[public]

comment = Public Stuff

path = /home/public

public = yes

writable = yes

browseable = yes

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

systemctl enable smb

systemctl restart smb

 

[root@owl45 owl]# adduser owl45

[root@owl45 owl]# passwd owl45

owl45 사용자의 비밀 번호 변경 중

  암호:

  암호 재입력:

passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

[root@owl45 owl]# smbpasswd -a owl45

New SMB password:

Retype new SMB password:

Added user owl45.

 

또는 smbpasswd 사용시 일괄 samba 사용자 등록

# cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

 

[root@owl45 owl]# smbclient -L owl45 -l 192.168.0.45 -U owl45

Enter owl45's password:

Sharename       Type      Comment

---------       ----      -------

public          Disk      Public Stuff

IPC$            IPC       IPC Service (OWL45)

owl45           Disk      Home Directories

Server               Comment

---------            -------

Workgroup            Master

---------            -------

[root@owl43 samba]# mkdir /mnt/samba

[root@owl43 samba]# mount //owl45/public /mnt/samba

Password:

 

or

[root@owl43 samba]# mount -t cifs -o username=root -o password=xxxx //192.168.0.45/public /mnt/samba

 

 

[root@owl43 samba]# df

Filesystem            1K-blocks      Used  Available Use% Mounted on

/dev/mapper/vg_centos6-lv_root

                       51475068   7586392   41267236  16% /

tmpfs                    959772        76     959696   1% /dev/shm

/dev/sda1                487652     36278     425774   8% /boot

/dev/mapper/vg_centos6-lv_home

                        9746360     50924    9193676   1% /home

//owl45/public        231226424 112693584  106787152  52% /mnt/samba