root@wl ~ # /usr/sfw/sbin/smbd -V Version 3.0.35 root@wl ~ # cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf root@wl ~ # vi /etc/sfw/smb.conf ... workgroup = MYGROUP server string = Share Server security = user dos charset = CP949 unix charset = UTF-8 ... #============================ Share Definitions ==============================1) ... root@wl ~ # vi /etc/services 2) ... netbios-ns 137/tcp # NETBIOS Name Service netbios-ns 137/udp # NETBIOS Name Service netbios-dgm 138/tcp # NETBIOS Datagram Service netbios-dgm 138/udp # NETBIOS Datagram Service netbios-ssn 139/tcp # NETBIOS Session Service netbios-ssn 139/udp # NETBIOS Session Service ... swat 901/tcp # Samba Web Adm.Tool ... root@wl ~ # svcadm enable svc:/network/samba:default 3) root@wl ~ # svcadm enable svc:/network/swat:default 3) root@wl ~ # /usr/sfw/bin/smbpasswd -a windy 4) New SMB password: Retype new SMB password: Added user windy. root@wl ~ #1) 공유할 디렉토리를 지정하는 부분이다. smb.conf-example 은 기본으로 각 사용자의 홈 디렉토리를 [숨김]형식으로 공유하고 있다.
[global] workgroup = WORKGROUP server string = SAMBA Server security = user hosts allow = 192.168.1. 192.168.2. 127. netbios name = HOSTNAME load printers = yes ; guest account = pcguest log file = /var/samba/log/log.%m max log size = 50 # 홈 디렉토리 서정 [homes] path = /export/home/%s comment = Home Directories browseable = no guest ok = no writable = yes # 프린터 설정 [printers] comment = All Printers path = /var/spool/samba guest ok = no writable = no printable = yes
root@wl ~ # /usr/sfw/bin/smbclient //192.168.0.10/windy 12345 -U windy
Domain=[WL] OS=[Unix] Server=[Samba 3.0.35]
smb: \> ?
? altname archive blocksize cancel
case_sensitive cd chmod chown close
del dir du exit get
getfacl hardlink help history lcd
link lock lowercase ls mask
md mget mkdir more mput
newer open posix posix_open posix_mkdir
posix_rmdir posix_unlink print prompt put
pwd q queue quit rd
recurse reget rename reput rm
rmdir showacls setmode stat symlink
tar tarmode translate unlock volume
vuid wdel logon listconnect showconnect
!
smb: \> dir
...
B 10485760 Fri Feb 26 14:43:15 2010
...
smb: \> put A
putting file A as \A (6157.5 kb/s) (average 6157.5 kb/s)
smb: \> get B
getting file \B of size 10485760 as B (33795.4 kb/s) (average 33795.4 kb/s)
smb: \> dir
...
A A 10485760 Fri Feb 26 14:42:58 2010
B 10485760 Fri Feb 26 14:43:15 2010
38466 blocks of size 262144. 38386 blocks available
smb: \> exit
put, get 외에 mget, mput, tar 명령도 유용하다.
C:\Documents and Settings\windy>net use 새 연결 정보가 저장됩니다. 목록에 항목이 없습니다. C:\Documents and Settings\windy>net use \\192.168.0.10\windy 12345 /user:windy 명령을 잘 실행했습니다. C:\Documents and Settings\windy>net use 새 연결 정보가 저장됩니다. 상태 로컬 원격 네트워크 ------------------------------------------------------------------------------- OK \\192.168.0.10\windy Microsoft Windows 네트워크 명령을 잘 실행했습니다. C:\Documents and Settings\windy>net use \\192.168.0.10\windy /delete \\192.168.0.10\windy이(가) 제거되었습니다. C:\Documents and Settings\windy>
root@wll ~ # mount -t cifs -o username=windy,password=12345 //192.168.0.10/windy /a
root@wll ~ # df -h /a
//192.168.0.10/windy
2.0T 2G 1.8T 2% /a
root@wll ~ #
|
|
Copyright © 2004-2010 Jo HoSeok. All rights reserved. |