Thursday, August 14, 2008

Samba Video tutorial

วันนี้ท่องเน็ตอยู่ ๆ ก็เจอวีดีโอช่วยสอนการใช้และการ setup Samba server ที่ดีๆเข้า จึงได้ดาวน์โหลดมาศึกษา
เนื้อหาง่ายดี ยังไม่เข้าขั้น advance เท่าไหร admin มือเก๋า ข้ามไปได้ ส่วนผู้ใช้งานมื่อใหม่อย่างเรา น่าสนใจทีเดียว

ในวิดีโอ 1 สอนให้ใช้ linux เข้าถึงแชร์ไฟล์ใน windows โดยเรียกไฟล์จาก windows ผ่าน msclient ได้โชว์
คำสั่งต่าง ๆ ให้เห็นเป็นบุญ ดังนี้

rpm -qa | grep smb
rpm -ql | grep samba

ผลของคำสั่งแสดงให้เห็นว่ามีการติดตั้ง package samba เวอร์ชั่นอะไรลงไป



คำสั่ง smbclient -L winxp -U administrator
ตามด้วยพร้อมสำหรับใส่พาสเวิร์ด

เป็นคำสั่งให้มองเห็นว่าในเครื่อง windowsXP นั้นมีแชร์อะไรเปิดอยู่บ้าง โดย ชื่อ winxp ที่อยู่หลัง -L นั้น
เป็นชื่อของคอมพิวเตอร์ windowsXP ตรวจสอบได้จากการคลิกขวา MyComputer และเลือกดูที่ชื่อคอมพิวเตอร์

smbclient //winxp/install -U administrator
password:

เป็นคำสั่งเข้าใช้งานแชร์ชื่อว่า install ในเครื่อง XP ด้วย administrator user

ตรวจสอบดูว่าเราสามารถใช้คำสั่งอะไรได้บ้างจาก msclient ด้วยเครื่องหมาย ? ที่พร้อมของ smbclient
จะปรากฏคำสั่งเรียงรายออกมาให้เลือกใช้ได้ตามความเหมาะสม



ในพร้อมของคำสั่ง msclient เหมือนคำสั่ง ftp ที่ได้เข้าไปยัง ftp server ได้แล้ว เหมือนหนึ่งว่าได้เข้าไปนั่ง
ที่คอมพิวเตอร์เครื่องนั้น ๆ แล้ว จึงสามารถจัดการไฟล์ด้วยการ copy มาไว้ที่เครื่องเราหรือจะโยนไฟล์ที่เครื่องเราไป
ที่เครื่องของ xp ก็ได้ คำสั่งต่าง ๆ ที่เราได้รู้จาก ? เอามาใช้ประโยชน์ เช่น

get filename คำสั่ง get ตามด้วยชื่อไฟล์ เป็นการ copy ไฟล์ที่ระบุมายัง linux
mget * เหมือนคำสั่ง get เพียงแต่ copy ครั้งละหลาย ๆไฟล์
ls ตรวจสอบว่าทีไดเรกปัจจุบันที่เรา login เข้ามาแล้วมีไฟล์อะไรบ้าง หากเราจะดูว่าแล้วที่ linux ของเราหละ
ขณะนี้มีไฟล์อะไรบ้างก็ใช้คำสั่ง ! ls
cd directory คำสั่ง cd ตามด้วย ไดเรกทอรีเป็นการเข้าไปยังไดเรกทอรีนั้น ๆ การตรวจสอบว่าขณะนี้เราอยู่ที่
ไดเรกทอรีอะไรให้ใช้คำสั่ง pwd
put และ mput เป็นคำสั่งโยนไฟล์จากเครื่อง linux ไปยังไดเรกทอรีปลายทางใน windows
ออกจากคำสั่ง msclient ด้วย quit

ใน windows เราไดเคย map drive ของเครื่องอื่น ๆ เข้ามาเป็น drive ตัวหนึ่งในเครื่องเพื่อจะได้ใช้งานได้โดยสะดวก
ใน linux ก็สามารถ map drive ลักษณะนั้นได้ เรียกว่าการ mount ซึ่งการ mount ในลีนุกซ์จะแตกต่างจากวินโดสว์
ที่ต้องสร้างไดเรกทอรีขึ้นมารองรับเสียก่อน และเข้าถึงแชร์นั้นโดยผ่านไดเรกทอรีที่สร้างนั้น ในตัวอย่างของวีดีโอนี้ map แชร์ชื่อว่า install ในวินโดวส์เข้ามาเป็นไดเรกทอรีในลีนุกซ์ และเข้าใช้งาน แชร์ install ผ่านไดเรกทอรี นั้น ดังนี้

สร้างไดเรกทอรีขึ้นมารองรับ mkdir /media/samba
map แชร์ด้วยคำสั่ง

smbmount //winxp/install /media/samba -o username=administrator

การยกเลิก drive ที่ map เข้ามาแล้ว ด้วยคำสั่ง smbumount /media/samba

จบวีดีช่วยสอนในไฟล์ที่ 1 เท่านี้

Samba Linux Server


Samba sets up network shares for chosen Unix directories (including all contained
subdirectories). These appear to Microsoft Windows users as normal Windows folders
accessible via the network. Unix users can either mount the shares directly as part of their file structure or, alternatively, can use a utility, smbclient (libsmb) installed with Samba to read the shares with a similar interface to a standard command line FTP program. Each directory can have different access privileges overlaid on top of the normal Unix file protections. For example: home directories would have read/write access for all known users, allowing each to access their own files. However they would still not have access to the files of others unless that permission would normally exist. Note that the netlogon
share, typically distributed as a read only share from /etc/samba/netlogon, is the logon

directory for user logon scripts.

Configuration is achieved by editing a single file (typically installed as /etc/smb.conf or /etc/samba/smb.conf). samba can also provide user logon scripts and group policy
implementation through poledit.

CODE

http://rapidshare.com/files/132632180/samba1.avi
http://rapidshare.com/files/132686954/samba2.avi
http://rapidshare.com/files/132632793/samba3.avi
http://rapidshare.com/files/132633169/samba4.avi
http://rapidshare.com/files/132633301/samba5.avi
http://rapidshare.com/files/132634112/samba6.avi
http://rapidshare.com/files/132751641/samba7_cupsprinting.avi

0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More