1. sunfreeware.com에서 O/S에 맞는 samba binary file을 down 받은후 pkgadd로 설치한다.
2. /etc/inet/inetd.conf 화일 입니다.
# SMB connections handled by Samba
swat stream tcp nowait root /opt/samba/bin/swat swat
netbios-ssn stream tcp nowait root /opt/samba/bin/smbd smbd
netbios-ns dgram udp wait root /opt/samba/bin/nmbd nmbd
bootps dgram udp wait root /usr/sbin/bootpd bootpd
3. /etc/services 화일 입니다.
swat 901/tcp # Samba configuration tool
netbios-ssn 139/tcp # Samba
netbios-ns 137/udp # Samba
4. ps -ef | grep inetd
root 144 1 0 11월 06 ? 14:25 /usr/sbin/inetd -s -t
root 5210 5176 0 09:54:44 pts/1 0:00 grep inetd
kill -HUP 144
5. PC에서 http://hostname:901
6. sample smb.conf 화일 /opt/samba/lib/smb.conf
# Samba config file created using SWAT
# from localhost (127.0.0.1)
# Date: 2001/07/13 11:47:19
# Global parameters
[global]
workgroup = INITDATA
netbios name = SHARK
server string = Samba Server
security = SHARE
log file = /opt/samba/var/log.%m
max log size = 50
dns proxy = No
[sales]
comment = sales
path = /u01/init/sales
guest ok = Yes
writeable = Yes
hosts allow = ALL
[bslee]
comment = bslee
path = /u01/init/bslee
guest account = bslee
writeable = Yes
guest ok = Yes
hosts allow = ALL
[tech]
comment = technical support team
path = /u01/init/tech
guest account = tech
writeable = Yes
hosts allow = ALL
[yjlee]
path = /u01/init/yjlee
guest account = yjlee
writeable = Yes
guest ok = Yes
hosts allow = ALL
[khseo]
comment = khseo
path = /u01/init/sales
guest account = khseo
writeable = Yes
guest ok = Yes
hosts allow = ALL
[mycroft]
path = /u01/init/mycroft
guest account = mycroft
writeable = Yes
guest ok = Yes
hosts allow = ALL
7. sample samba 자동 실행 스크립트 /etc/init.d/samba, /etc/rc2.d/S99samba
#!/sbin/sh
#
# Start Samba SMB file/print services
# Set environment
PATH=/usr/bin:/sbin:/usr/sbin export PATH
# Samba directory
SAMBA_DIR=/opt/samba
SAMBA_SMBD_DEBUG_LEVEL=0
SAMBA_NMBD_DEBUG_LEVEL=0
SAMBA_SMBD_LOG=/var/opt/samba/log.smb
SAMBA_NMBD_LOG=/var/opt/samba/log.nmb
# Kill all processes matching a certain name
kill_proc () {
ps -ef | grep "" | grep -v grep | while read PROC; do \
PID=`echo ${PROC} | awk '{ print }'`
[ ${PID} -gt 0 ] && kill ${PID}
done
}
case "" in
start)
${SAMBA_DIR}/bin/smbd -D -d ${SAMBA_SMBD_DEBUG_LEVEL:=0} \
-l ${SAMBA_SMBD_LOG:=/var/opt/samba/log.smb}
${SAMBA_DIR}/bin/nmbd -D -d ${SAMBA_NMBD_DEBUG_LEVEL:=0} \
-l ${SAMBA_NMBD_LOG:=/var/opt/samba/log.nmb}
echo "Samba services started."
;;
stop)
kill_proc "${SAMBA_DIR}/bin/nmbd"
kill_proc "${SAMBA_DIR}/bin/smbd"
echo "Samba services stopped."
;;
*)
echo "Usage: {vContent} { start | stop }"
exit 1
;;
esac
exit 0
2. /etc/inet/inetd.conf 화일 입니다.
# SMB connections handled by Samba
swat stream tcp nowait root /opt/samba/bin/swat swat
netbios-ssn stream tcp nowait root /opt/samba/bin/smbd smbd
netbios-ns dgram udp wait root /opt/samba/bin/nmbd nmbd
bootps dgram udp wait root /usr/sbin/bootpd bootpd
3. /etc/services 화일 입니다.
swat 901/tcp # Samba configuration tool
netbios-ssn 139/tcp # Samba
netbios-ns 137/udp # Samba
4. ps -ef | grep inetd
root 144 1 0 11월 06 ? 14:25 /usr/sbin/inetd -s -t
root 5210 5176 0 09:54:44 pts/1 0:00 grep inetd
kill -HUP 144
5. PC에서 http://hostname:901
6. sample smb.conf 화일 /opt/samba/lib/smb.conf
# Samba config file created using SWAT
# from localhost (127.0.0.1)
# Date: 2001/07/13 11:47:19
# Global parameters
[global]
workgroup = INITDATA
netbios name = SHARK
server string = Samba Server
security = SHARE
log file = /opt/samba/var/log.%m
max log size = 50
dns proxy = No
[sales]
comment = sales
path = /u01/init/sales
guest ok = Yes
writeable = Yes
hosts allow = ALL
[bslee]
comment = bslee
path = /u01/init/bslee
guest account = bslee
writeable = Yes
guest ok = Yes
hosts allow = ALL
[tech]
comment = technical support team
path = /u01/init/tech
guest account = tech
writeable = Yes
hosts allow = ALL
[yjlee]
path = /u01/init/yjlee
guest account = yjlee
writeable = Yes
guest ok = Yes
hosts allow = ALL
[khseo]
comment = khseo
path = /u01/init/sales
guest account = khseo
writeable = Yes
guest ok = Yes
hosts allow = ALL
[mycroft]
path = /u01/init/mycroft
guest account = mycroft
writeable = Yes
guest ok = Yes
hosts allow = ALL
7. sample samba 자동 실행 스크립트 /etc/init.d/samba, /etc/rc2.d/S99samba
#!/sbin/sh
#
# Start Samba SMB file/print services
# Set environment
PATH=/usr/bin:/sbin:/usr/sbin export PATH
# Samba directory
SAMBA_DIR=/opt/samba
SAMBA_SMBD_DEBUG_LEVEL=0
SAMBA_NMBD_DEBUG_LEVEL=0
SAMBA_SMBD_LOG=/var/opt/samba/log.smb
SAMBA_NMBD_LOG=/var/opt/samba/log.nmb
# Kill all processes matching a certain name
kill_proc () {
ps -ef | grep "" | grep -v grep | while read PROC; do \
PID=`echo ${PROC} | awk '{ print }'`
[ ${PID} -gt 0 ] && kill ${PID}
done
}
case "" in
start)
${SAMBA_DIR}/bin/smbd -D -d ${SAMBA_SMBD_DEBUG_LEVEL:=0} \
-l ${SAMBA_SMBD_LOG:=/var/opt/samba/log.smb}
${SAMBA_DIR}/bin/nmbd -D -d ${SAMBA_NMBD_DEBUG_LEVEL:=0} \
-l ${SAMBA_NMBD_LOG:=/var/opt/samba/log.nmb}
echo "Samba services started."
;;
stop)
kill_proc "${SAMBA_DIR}/bin/nmbd"
kill_proc "${SAMBA_DIR}/bin/smbd"
echo "Samba services stopped."
;;
*)
echo "Usage: {vContent} { start | stop }"
exit 1
;;
esac
exit 0