반응형

   

  1. SAMBA YUM으로 설치

    # root > yum install samba*

  2. 유저등록

    # root > useradd xxxx

    # root > passwd xxxx

       

  3. 리눅스에서 윈도우로 공유할 폴더만들기, 권한설정

    # root > mkdir /winshare

    # root > chmod 755 winshare

       

  4. 윈도우에서 공인으로 사용할경우 공유기에서 포트포워딩필요

    외부 139, 445 포트를 내부사설아이피 192.168.10.211로 포트포워딩설정

       

    ※ 포트포워딩 안되있으면 다음과같은 에러가 뜹니다. ※

    #root > smbclient //118.216.XX.XX/able_share -U username

    timeout connecting to 118.216.XX.XX:445

    timeout connecting to 118.216.XX.XX:139

       

       

  5. SAMBA 설치후 윈도우에 공유할 그룹명확인

       

  6. 방화벽 중단 설정

       

  7. 윈도우 현재 사용중인 아이피 확인

    -->사진은 내부로컬일경우입니다.

    공인아이피 사용할 경우 확인방법이 다릅니다. 확인하세요.

       

  8. 삼바와 윈도우간에 네트워크 공유할 폴더만들기

       

  9. 삼바 samba.conf 수정

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

    # This is the main Samba configuration file. You should read the

    # smb.conf(5) manual page in order to understand the options listed

    # here. Samba has a huge number of configurable options (perhaps too

    # many!) most of which are not shown in this example

       

    중략

    [global]

       

    # ----------------------- Network Related Options -------------------------

    # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can

    # specifiy it as a per share option as well

    #

    workgroup = KFTEL-PBX

    server string = KFTEL-PBX SHARE

       

    ;        netbios name = MYSERVER

       

    ;        interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24

    #공인아이피사용할경우

            hosts allow = 118.222.XX.XX. 127. 192.168.10.

     

    #윈도우와 폴더속성 및 폰트설정

     dos charset = cp949

      unix charset = euckr

      create mask = 0775

      directory mask = 0775  

       

    # --------------------------- Logging Options -----------------------------

    #

    # Log File let you specify where to put logs and how to split them up.

    #

    # Max Log Size let you specify the max size log files should reach

       

    # logs split per machine

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

    # max 50KB per log file, then rotate

    # 로그파일 사이즈

            max log size = 5000

       

    # ----------------------- Standalone Server Options ------------------------

    #접속자 구분방법, user=아이디,패스워드로 인증, share = 인증없음

    security = user

    passdb backend = tdbsam

       

       

    # ----------------------- Domain Members Options ------------------------

    #

    # Security must be set to domain or ads

    #

    # Use the realm option only with security = ads

    # Specifies the Active Directory realm the host is part of

    #

    # 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.

    #

    # Use password server option only with security = server or if you can't

    # use the DNS to locate Domain Controllers

    # The argument list may include:

    # password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]

    # or to auto-locate the domain controller/s

    # password server = *

       

       

    ;        security = domain

    ;        passdb backend = tdbsam

    ;        realm = MY_REALM

       

    ;        password server = <NT-Server-Name>

       

    # ----------------------- Domain Controller Options ------------------------

    #

    # Security must be set to user for domain controllers

    #

    # 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.

    #

    # Domain Master specifies Samba to be the Domain Master Browser. This

    # allows Samba to collate browse lists between subnets. Don't use this

    # if you already have a Windows NT domain controller doing this job

    #

    # Domain Logons let Samba be a domain logon server for Windows workstations.

    #

    # Logon Scrpit let yuou specify a script to be run at login time on the client

    # You need to provide it in a share called NETLOGON

    #

    # Logon Path let you specify where user profiles are stored (UNC path)

    #

    # Various scripts can be used on a domain controller or stand-alone

    # machine to add or delete corresponding unix accounts

    #

    ;        security = user

    ;        passdb backend = tdbsam

       

    ;        domain master = yes

    ;        domain logons = yes

       

    # the login script name depends on the machine name

    ;        logon script = %m.bat

    # the login script name depends on the unix user used

    ;        logon script = %u.bat

    ;        logon path = \\%L\Profiles\%u

    # disables profiles support by specifing an empty path

    ;        logon path =

       

    ;        add user script = /usr/sbin/useradd "%u" -n -g users

    ;        add group script = /usr/sbin/groupadd "%g"

    ;        add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"

    ;        delete user script = /usr/sbin/userdel "%u"

    ;        delete user from group script = /usr/sbin/userdel "%u" "%g"

    ;        delete group script = /usr/sbin/groupdel "%g"

       

       

    # ----------------------- Browser Control Options ----------------------------

    #

    # set local master to no if you don't want Samba to become a master

    # browser on your network. Otherwise the normal election rules apply

    #

    # OS Level determines the precedence of this server in master browser

    # elections. The default value should be reasonable

    #

    # Preferred Master causes Samba to force a local browser election on startup

    # and gives it a slightly higher chance of winning the election

    ;        local master = no

    ;        os level = 33

    ;        preferred master = yes

       

    #----------------------------- Name Resolution -------------------------------

    # Windows Internet Name Serving Support Section:

    # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

    #

    # - WINS Support: Tells the NMBD component of Samba to enable it's WINS Server

    #

    # - WINS Server: Tells the NMBD components of Samba to be a WINS Client

    #

    # - WINS Proxy: Tells Samba to answer name resolution queries on

    # behalf of a non WINS capable client, for this to work there must be

    # at least one        WINS Server on the network. The default is NO.

    #

    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names

    # via DNS nslookups.

       

    ;        wins support = yes

    ;        wins server = w.x.y.z

    ;        wins proxy = yes

       

    ;        dns proxy = yes

       

    # --------------------------- Printing Options -----------------------------

    #

    # Load Printers let you load automatically the list of printers rather

    # than setting them up individually

    #

    # Cups Options let you pass the cups libs custom options, setting it to raw

    # for example will let you use drivers on your Windows clients

    #

    # Printcap Name let you specify an alternative printcap file

    #

    # You can choose a non default printing system using the Printing option

    #프린터사용 유무

    load printers = yes

    cups options = raw

       

    중략

       

    #============================ Share Definitions ==============================

    [winuser]

    comment = KFTEL SHARE

    guest ok=no

    create mask = 0775

    browseable = no

    writable = yes

    valid users =qmark50

    path = /winshare

       

    [homes]

    comment = Home Directories

    browseable = no

    writable = yes

    ;        valid users = %S

    ;        valid users = MYDOMAIN\%S

       

    [printers]

    comment = All Printers

    path = /var/spool/samba

    browseable = no

    guest ok = no

    writable = no

    printable = yes

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

       

  10. 삼바 시작
    # root > /etc/init.d/smb start

       

  11. 테스트해보기1 : 윈도우에서 리눅스공유폴더로 접근시

    윈도우 탐색기에서 \\리눅스서버아이피\계정명 이렇게 치면

    Security 방식에 따라 user방식이면 패스워드를 물어볼것이고

    Share방식이면 그냥 탐색될것입니다.

       

  12. 테스트해보기2 : 리눅스에서 윈도우공유폴더로 접근시
  13. 윈도우쪽에 설정되어있는 공유폴더검색

    # root > smbclient -L qmark50 -I 118.216.XX.XX

       

  14. 윈도우폴더 바로 탐색하기

    #root > smbclient //118.216.XX.XX/able_share -U qmark50

       

  15. 윈도우폴더 마운트해서 사용하기

    #root > mkdir /mnt/test22

    #root > mount -t cifs -o username="qmark50" //윈도우아이피/공유폴더 /mnt/test

       

       

    이상!~

    저는 이렇게 해서 데스크탑에 저장공간이 부족할때 사용하죠..흐흐흐

      

반응형

'각종TIPs > LINUX' 카테고리의 다른 글

r8111드라이버  (0) 2011.05.23
공인 default G/W 잡기 쉘스크립트  (0) 2010.09.27
TCPDUMP  (0) 2010.03.11
sed 에서 "Unterminated `s' command" 에러나올때  (0) 2010.03.11
뒤에서부터 자르기  (0) 2010.03.11

+ Recent posts