swat는 xinet/inet을 통해 구동되는 웹서비스이다.
일단 swat를 사용하기 위해서는 samba 컴파일 시에
--without-swat가 있었는지 없었는지 확인을 해야한다.
(안하면 나 처럼 개고생 ㄱ-)

아무튼 기본적으로 사용하는 포트는 901번이며

Step 1. /etc/services 에 위의 901번 포트를 추가 해야 한다.
# more /etc/services
...
accessbuilder   888/udp
swat            901/tcp                 # samba web configuration tool
ftps-data       989/tcp                 # ftp protocol, data, over TLS/SSL
...


[링크 : http://www.bilbos-stekkie.com/swat/starting_swat_us.php]

Step 2. /etc/xinetd.d/swat를 추가 한다.
# more /etc/xinetd.d/swat
# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
    port    = 901
    socket_type     = stream
    wait    = no
    only_from = localhost
    user    = root
    server  = /usr/sbin/swat
    log_on_failure  += USERID
    disable = no
}

[링크 : http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2681240]

Step 3. xinetd를 restart 시킨다.
# service xinetd restart


Step 4. 웹브라우저에서 901번 포트로 접속한다.
http://localhost:901
혹은
http://serverip:901



* 확인필요 *

--without-swat 로 설정하고 컴파일후 install을 해도
swat에서 사용하는 각종 html 파일들이 복사되지 않기 때문에
아래와 같은 에러가 발생하는 것으로 보인다.

500 Server Error

chdir failed - the server is not configured correctly


Posted by 구차니
Posted by 구차니
제목이 조금 낚시인가?
윈도우에서 net view 라고 명령창에서 치면 현재 사용가능한 네트워크 목록이 나오는데
특정 호스트를 nbtstat -a [hostname] 으로 하면 목록이 나오는데,
거기에 <1D> 라는 녀석이 있는게 (로컬) 마스터 브라우저이다.

C:\>nbtstat -a localhost

로컬 영역 연결:
Node IpAddress: [192.168.10.96] Scope Id: []

           NetBIOS Remote Machine Name Table

       Name               Type         Status
    ---------------------------------------------
    LOCALHOST      <00>  UNIQUE      Registered
    LOCALHOST      <03>  UNIQUE      Registered
    LOCALHOST      <20>  UNIQUE      Registered
    WORKGROUP      <1E>  GROUP       Registered
    WORKGROUP      <00>  GROUP       Registered

    MAC Address = 00-00-00-00-00-00


workgroup
or
nt_domain
<1B> unique Domain Master Browser
This name identifies the Domain Master Browser (DMB).

A Samba server can behave as a DMB without also being a Primary Domain Controller (PDC). The existence of a PDC promotes the Workgroup to NT Domain status, in which case we write nt_domain<1B> instead of workgroup<1B>. If there is a PDC, it must provide the DMB service for the NT Domain.

Domain Controllers (both Primary and Backup) register the nt_domain<1C> Internet Group name. Registration of the nt_domain<1B> name effectively distinguishes the PDC from all of the other DCs in the domain. The NBNS will ensure that the IP address of the (unique) <1B> name is the first in the list of IP addresses

nt_domain <1C> Internet group Domain Controller
Every domain controller in the NT Domain will register this group name. The NBNS (WINS server) is expected to store all of the IP addresses associated with the name, though it will report at most 25 IP addresses in a NAME QUERY RESPONSE.

The first entry in the list should be the IP address of the Primary Domain Controller (PDC). The rest of the IPs are ordered most recent first. This is atypical handling for group names under WINS. WINS (and, therefore, any NBNS which is WINS-compatible) will usually report only the limited broadcast address (255.255.255.255) when queried for a group name.

workgroup <1D> LAN unique Local Master Browser
This name identifies the Local Master Browser (LMB, sometimes called simply "Master Browser") for a subnet. WINS servers (and any NBNS which is WINS-compatible) will accept registration for <1D> unique names, but when queried will always reply with a NEGATIVE NAME QUERY RESPONSE. As a result, the LMB name is unique within its local subnet only.
workgroup <1E> group Browser Election Service
Every node that is capable of acting as a browser registers this group name so that it can listen for election announcements.
\x01\x02__MSBROWSE__\x02 <01> group Local Master Browser
This group name is registered by all Local Master Browsers (LMBs). It allows LMBs on a local LAN to find one another in order to exchange Browse Lists. This is how Browse Lists for multiple Workgroups and/or NT Domains are combined.


[링크 : http://www.antionline.com/showthread.php?t=247089]
[링크 : http://ubiqx.org/cifs/Appendix-C.html]
Posted by 구차니

deadtime (G)


The value of the parameter (a decimal integer) represents the number of minutes of inactivity before a connection is considered dead, and it is disconnected. The deadtime only takes effect if the number of open files is zero.

This is useful to stop a server's resources being exhausted by a large number of inactive connections.

Most clients have an auto-reconnect feature when a connection is broken so in most cases this parameter should be transparent to users.

Using this parameter with a timeout of a few minutes is recommended for most systems.

A deadtime of zero indicates that no auto-disconnection should be performed.

Default: deadtime = 0

Example: deadtime = 15



keepalive (G)


The value of the parameter (an integer) represents the number of seconds between keepalive packets. If this parameter is zero, no keepalive packets will be sent. Keepalive packets, if sent, allow the server to tell whether a client is still present and responding.

Keepalives should, in general, not be needed if the socket has the SO_KEEPALIVE attribute set on it by default. (see socket options). Basically you should only use this option if you strike difficulties.

Default: keepalive = 300

Example: keepalive = 600



[링크 : http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html]

아래의 문서에서 keepalive 와 deadtime 발견
[링크 : http://xbmc.org/forum/showthread.php?t=312]

deadtime은 분단위로,
keepalive는 초단위로 설정한다.


Posted by 구차니
첫째... 삼바 계정 공유에 쓰기 권한이 없는 경우...
둘째... 삼바 계정과 공유한 디렉토리의 소유권이 다른 경우.
세째... 삼바 계정이 해당 공유 디렉토리에 쓰기 권한 없는 경우

[링크 : http://kldp.org/node/64194]
Posted by 구차니
아무생각없이

mount -t cifs -o user=guest,password=guest 로 했더니

 CIFS VFS: Send error in SessSetup = -13
 CIFS VFS: Send error in SessSetup = -13
mount: mounting \\server\share on /mnt/samba failed: Permission denied

이런 에러가 발생한다.

아무튼 제어판 - 관리도구 - 컴퓨터 관리 에서 확인해보니

Guest User 등록 정보

Guest Group 등록 정보

아무튼 검색을 해보니, 기본적으로 윈도우 간에 파일 공유는 guest 로 로그인을 한다고 하는데,
윈도우 끼리는 접속이 되는데 삼바에서는 guest로 접속이 되지 않는다. 흐음.. 기본 암호가 다르게 쳐서 그런가?

아무튼 guest 대신에 임의의 아이디를 만들면 접속에 이상이 없다.
Posted by 구차니
딱히 용어로 적힌건 발견하지 못했는데

# nmblookup -S "SERVERNAME"
querying STREAM on 192.168.10.255
192.168.10.4 STREAM<00>
Looking up status of 192.168.10.4
        STREAM          <00> -         B <ACTIVE>
        WORKGROUP       <00> - <GROUP> B <ACTIVE>
        STREAM          <20> -         B <ACTIVE>
        WORKGROUP       <1e> - <GROUP> B <ACTIVE>

        MAC Address = 00-00-00-00-00-00

nmblookup으로 domain을 해석할때, <00> 이나 <20> <1e> 이러한 값들이 출력이 되는데
그 의미는 아래의 표에 나와있다.

Table 29.1. Unique NetBIOS Names

MACHINENAME<00> Server Service is running on MACHINENAME
MACHINENAME<03> Generic machine name (NetBIOS name)
MACHINENAME<20> LanMan server service is running on MACHINENAME
WORKGROUP<1b> Domain master browser

Table 29.2. Group Names

WORKGROUP<03> Generic name registered by all members of WORKGROUP
WORKGROUP<1c> Domain cntrollers/netlogon servers
WORKGROUP<1d> Local master browsers
WORKGROUP<1e> Browser election service


[링크 : Unique NetBIOS names and group names]
Posted by 구차니
비슷비슷한 내용 -ㅁ-
anonymous / secure 설정에 대한 smb.conf의 예제들이 있다.

[링크 : http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html]
[링크 : http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/s1-samba-servers.html]

2009.12.24 추가
삼바 공식 smb.conf man page
[링크 : http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html]

smb.conf 한글 번역 내용 - oops.org
[링크 : http://sec.tistory.com/entry/smbconf-%EC%84%A4%EC%A0%95]
Posted by 구차니
서버 설정후 localhost에서 접속을 시도하려고
smbclient -L localhost 하는데 에러가 발생했다.

Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled

일단 찾아봐도 딱히 답은 없지만..

아마도 security = SHARE 를 선택했을 경우, smb.conf에
client lanman auth = yes
lanman auth = yes
가 빠져 있으면 생기는 에러로 생각된다.

[링크 : http://sidux.com/PNphpBB2-viewtopic-t-14163.html]
Posted by 구차니
# smbd -S -F
smbd version 3.0.23c started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
Unable to open printcap file /etc/printcap for read!
Unable to open printcap file /etc/printcap for read!
ERROR: Could not determine network interfaces, you must use a interfaces config line

3.2.0 에서는 이런게 없었는데..
아무튼 3.0.23c 에서는
smb.conf의 global 섹션에 interface가 있어야 한다.

[global]
    interface = eth0

[링크 : http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg223269.html]





./samba-3.0.23c/source/ 에서 아래의 명령을 실행하면 테스트 프로그램이 컴파일 된다.
gcc -g -o interfaces lib/interfaces.c -DAUTOCONF_TEST=1 -DHAVE_IFACE_IFCONF=1

[링크 : http://lists.samba.org/archive/samba-technical/2006-February/045430.html]
RE - [링크 : http://lists.samba.org/archive/samba-technical/2006-February/045440.html]
Posted by 구차니