[ CentOS 7 에서 SAMBA Server 설정 방법 ]

 

1. samba 관련 패키지 설치 및 기동

sudo yum install samba samba-client samba-common

systemctl enable smb
systemctl enable nmb
systemctl start smb
systemctl start nmb

2. 공유하고 싶은 폴더 생성

# /share 폴더 생성
mkdir /share
# 권한 설정
chmod 777 /share

3. SAMBA 권한 설정

3-1. 계정 로그인 없이 ( Anonymous ) 접속

- /etc/samba/smb.conf 설정

[global]
        workgroup = WORKGROUP
        netbios name = centos
        security = user
        map to guest = bad user

[Anonymous]
        comment = Anonymous File Server Share
        path = /share
        browsable =yes
        writable = yes
        guest ok = yes
        read only = no
        public = yes
        force create mode = 0777
        directory mask = 0777

3-2. 계정 설정

- Samba 접속용 계정 생성

useradd -M -s /sbin/nologin smbuser

 

- Samba 계정 비밀번호 설정

# smbpasswd -a smbuser

New SMB password:
Retype new SMB password:
Added user smbuser.

 

- /etc/samba/smb.conf 설정

[global]
        workgroup = WORKGROUP
        netbios name = centos
        security = user
        map to guest = bad user

[share]
        comment = share
        path = /share
        public = no
        writable = yes
        printable = yes
        write list = smbuser
        # 계정이 여러개일 경우 아래와 같이 추가 
        # write list = smbuser app root
        create mask = 0777
        directory mask = 0777

4. Samba 재기동

systemctl stop smb
systemctl stop nmb
systemctl start smb
systemctl start nmb

+ Recent posts