2007. 7. 3. 15:53

Samba for FreeBSD

#
#Samba for FreeBSD
#

#버전
FreeBSD
samba

#################
# 1. 설치
#################
삼바 pkg_add 명령을 이용하거나 포트에서 설치할 수 있다.

pkg_add -r samba

또는

cd /usr/ports/net/samba
make install clean

#################
# 2. 시작 스크립트
#################
삼바의 실행은 독립모드(standalone) 또는 inetd 모드로 실행 가능하다.

- 독립모드 실행
cd /usr/local/etc
cp smb.conf.default smb.conf

cd /usr/local/etc/rc.d
mv samba.sh.default samba.sh
/usr/local/etc/rc.d/samba.sh start

- inetd 모드로 실행할 결우 /etc/inetd.conf 파일에 다음 내용을 추가하고
  inetd 데몬을 재시작(killall -HUP inetd) 해준다.

# ——————————————————————-
netbios-ssn stream tcp nowait root /usr/local/sbin/smbd smbd
netbios-ns   stream udp nowait root /usr/local/sbin/nmbd nmbd
# ——————————————————————-

####################################
# 2. 설정파일(/usr/local/etc/smb.conf
####################################

# ——————————————————-
# smb.conf 설정 시작
# ——————————————————-
[global]
   workgroup = Workgroup
   server string = FileServer

   # 한국어 파일명 지원
   client code page = 949

   security = user
   encrypt passwords = Yes

   socket options = TCP_NODELAY IPTOS_LOWDELAY
   dns proxy = no

   log file = /var/log/log.%m
   max log size = 500

[homes]
   comment = Home Directories
   browseable = No
   read only = No

[pub]
   comment = public directory
   path = /home/pub
   writable = Yes
   browseable = Yes
# ——————————————————-
# smb.conf 설정 끝
# ——————————————————-

####################################
# 3. 삼바 사용자 계정과 비밀번호
####################################
삼바 설치과정에서 자동적으로 시스템 계정이 삼바 계정으로 추가 되어 있을 것이다.
삼바 계정 파일은 /usr/local/private/smbpasswd 이다.
삼바 계정 비밀번호는 시스템 계정 비밀번호와 별도로 관리되기 때문에 계정만들고
smbpasswd 명령으로 비밀번호를 입력해준다.

# 시스템 계정파일로 삼바 계정 파일을 만들려면 다음과 같이 해준다.
cat /etc/passwd | make_smbpasswd > /usr/local/private/smbpasswd

# 삼바 계정의 비밀번호를 변경한다.
smbpasswd user_name
(이곳에서 FreeBSD 계정의 패스워드를 다시 세팅해준다.)

###################################

###################################

#################
# 4. 삼바 시작
#################
/usr/local/etc/rc.d/samba.sh start
/usr/local/etc/rc.d/samba.sh stop
/usr/local/etc/rc.d/samba.sh restart

# inetd 모드일경우
killall -HUP inetd

#################
# 5. SWAT
#################
웹브라우저에서 삼바 설정을 관리하려면 swat을 설정하다.

/etc/inetd.conf 파일에 다음내용을 추가하고 inetd를 재시작 한다.
………………….
swat    stream  tcp     nowait/400      root    /usr/local/sbin/swat    swat
………………….

killall -HUP inetd

http://ipaddress:901/

SMB HOWTO
http://wiki.kldp.org/HOWTO//html/SMB/SMB-HOWTO.html

http://hanbitbook.co.kr/web/sample/1179/redhat72_chapter47.pdf

2007. 7. 3. 15:52

smb.conf 예제 파일

아래의 예제파일은
특정 아이디로 로그인 하여 공용 파일을 사용할수 있게 하는 경우와
모두 풀어준 공용 파일에 대한 예이다.

# Samba config file created using SWAT
# from 192.168.1.111 (192.168.1.111)
# Date: 2004/06/30 20:21:39

# Global parameters
[global]
client code page = 949
workgroup = ToyBSD 	server string = Samba Server( 파일 서버)
security = SHARE
encrypt passwords = Yes
username map = /usr/local/etc/users.map
log file = /var/log/log.%m
max log size = 500
socket options = TCP_NODELAY IPTOS_LOWDELAY
dns proxy = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[Woosu Open File Server]
comment = 사내 공용 파일 서버
path = /usr/home/woosu/pub
read only = No
guest ok = Yes

[Affairs Team]
comment = 경영관리부 파일 서버
path = /usr/home/ws11/pub
write list = ws11
read only = No