2013년 7월 22일 월요일

CentOS에서 Samba 설치

CentOS에서 Samba 설치


  1. 프로그램 설치
yum을 사용하여 samba를 설치한다.
$ sudo yum install –y samba



  1. 설정
A) /etc/samba/smb.conf를 설정한다.
# ----------------------- Network Related Options -------------------------
#
# workgroup = Workgroup
#
# server string is the equivalent of the NT Description field
#
# netbios name can be used to specify a server name not tied to the hostname
#
# Interfaces lets you configure Samba to use multiple interfaces
# If you have multiple network interfaces then you can list the ones
# you want to listen on (never omit localhost)
#
# Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
# specifiy it as a per share option as well
#
        unix charset = cp949
        dos charset = cp949
        display charset = cp949
        리눅스와 윈도우즈간의 언어셋 설정.

        workgroup = MYGROUP
        윈도우즈의 작업그룹명. ip 대역으로 접속시에는 아무거나 해도 상관없다.
        server string = Samba Server Version %v
        윈도우즈에서 접속시에 보여지는 서버이름. 
        네트워크 드라이브로 연결시에는 위의 서버명과 디렉토리명이 같이 표시되기 때문에 적절히 수정.
 
;       netbios name = local_CentOS
 
;       interfaces = lo eth0 192.168.1.2/24 192.168.2.13/24
       
hosts allow = 192.168.1.5 123.45.6.
       삼바서버에 접속할 수 있는 클라이언트 IP 대역 설정.
       (위의 경우 192.168.1.5 IP와 123.45.6. IP 대역에 대해 접속을 허용)


# ----------------------- Standalone Server Options ------------------------
#
# Security can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
 
       
security = user        passdb backend = tdbsam
        security = share (삼바서버에 사용자명/패스워드 인증없이 접속 가능)
        security = user (리눅스 계정 아이디로 접속 가능)
        user로 설정했을 경우, 환경설정 저장 후 리눅스 계정 패스워드와는 별도로 삼바서버에 패스워드를 등록해야 한다
#============= Share Definitions ====================
 
[homes]
        comment = Home Directories
        browseable = no
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S
삼바서버에 로그인한 사용자의 홈디렉토리 설정.
security = user로 설정되어 있을 경우, 로그인한 사용자의 디렉토리가 표시된다.
[test1_share]
        comment = test1_share
        path = /home/test
        writable = yes
        valid users = test1
로그인한 사용자에게 홈디렉토리 이외에 공유할 디렉토리를 설정해줄 수 있다.
위의 경우, "test1" 사용자에게 자신의 디렉토리 이외에 "/home/test" 디렉토리도 공유할 수 있게 해준다.
(참조: http://blog.naver.com/PostView.nhn?blogId=aramjo&logNo=120064643721)
B) 설정 후, 서비스를 재시작 한다.
$ service smb start


C) 서버에서 사용할 계정 패스워드를 설정한다.
$ smbpasswd -a test1
New SMB password:
Retype new SMB password:
Added user test1.


D) 윈도우에서 \\samba-server-ip\계정 명으로 접근한다.


  1. 네트웍 드라이브 설정
A) 탐색기의 컴퓨터 항목에서 오른클릭하여 네트웍 드라이버 연결 선택


B) IP 설정
C) 계정설정

D) 접속확인

댓글 없음:

댓글 쓰기