• No results found

Homework 5b: Homework 5b: Samba

N/A
N/A
Protected

Academic year: 2021

Share "Homework 5b: Homework 5b: Samba"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

Homework 5b:

Homework 5b:

Samba

Samba

(2)

Computer Center, CS, NCTU

2

Network

Network

-

-

based File Sharing (1)

based File Sharing (1)

‰ NFS (UNIX-based)

• mountd is responsible for mount request

• nfsd and nfsiod

‰ CIFS (Microsoft)

• Common Internet File System

• 網路芳鄰

(3)

Computer Center, CS, NCTU

3

Network

Network

-

-

based File Sharing (2)

based File Sharing (2)

‰ Difference between local filesystem and network filesystem

when accessing

• NetBIOS (API)

¾ Used to share or access network-based filesystem just as BIOS does in local filesystem

(4)

Computer Center, CS, NCTU

4

Network

Network

-

-

based File Sharing (3)

based File Sharing (3)

• NetBEUI (transport protocol)

¾ Transfer NetBIOS commands across network

¾ Each host can claim a name not used in network

(5)

Computer Center, CS, NCTU

5

Network

(6)

Computer Center, CS, NCTU

6

UNIX

UNIX

-

-

Windows communication

Windows communication

‰ SAMBA

• A UNIX application that speak SMB protocol

• Designed by Andrew Tridgwell, in 1991

(7)

Computer Center, CS, NCTU

7

What SAMBA can do?

What SAMBA can do?

‰ Sharing

• Sharing files or printers just like Microsoft does

• Authenticate user identity just like Microsoft does

• Resolve NetBIOS name just like Microsoft does

(8)

Computer Center, CS, NCTU

8

Install SAMBA

Install SAMBA

‰ Using ports

• % cd /usr/ports/net/samba

(9)

Computer Center, CS, NCTU

9

SAMBA components

SAMBA components

‰ Configuration files

• /usr/local/etc/smb.conf.default Æ /usr/local/etc/smb.conf

• /usr/local/etc/lmhosts

‰ Major execution files

• smbd (/usr/local/sbin/smbd)

¾ Management of sharing directories, files and printers

• nmbd (/usr/local/sbin/nmbd)

¾ Resolve NetBIOS name and manage workgroup

• smbpasswd (/usr/local/bin/smbpasswd)

(10)

Computer Center, CS, NCTU

10

SAMBA configuration file

SAMBA configuration file

‰ smb.conf

• Three sections

¾ Global Setting

¾ Printer Sharing Setting

¾ Home Sharing Setting

# comments [global] para1 = value1 [printers] para2 = value2 [homes] para3 = value3 [share-dir] para4 = value4

(11)

Computer Center, CS, NCTU

11

SAMBA configuration file

SAMBA configuration file

Global Setting (1)

Global Setting (1)

‰ Global Configuration

• workgroup

¾ Group name to join

¾ Ex: workgroup = chwong

• server string

¾ Description of this host

¾ Ex: server string = Samba Server of SA Course

• netbios name

¾ NetBIOS name of this host

¾ Ex: netbios name = sabsd

• Charset Settings

¾ “display charset”, “unix charset”, “dos charset”

¾ Ex:

display charset = CP950 unix charset = CP950 dos charset = CP950

• hosts allow

¾ Apply to all services, regardless or individual service setting;

(12)

Computer Center, CS, NCTU

12

SAMBA configuration file

SAMBA configuration file

Global Setting (2)

Global Setting (2)

• guest ok (or public = yes)

¾ If this is yes, no password is required

¾ Ex: guest ok = no

• guest account

¾ If guest can use this samba service, any guest request will map to this guest account

¾ Ex: guest account = ftp

• log file

¾ Full path of log file

¾ Ex: log file = /var/log/samba/log.%m

• max log size (KB)

(13)

Computer Center, CS, NCTU

13

SAMBA configuration file

SAMBA configuration file

Global Setting (3)

Global Setting (3)

• security = [share/user/server/domain]

¾ share: no need of id and password to login

¾ user: default option, login with id and password

¾ server: check id and password by another server

¾ domain: check id and password by domain controller

¾ Ex:

– security = user

(14)

Computer Center, CS, NCTU

14

SAMBA configuration file

SAMBA configuration file

Global Setting (4)

Global Setting (4)

‰ Example of global setting

[global]

workgroup = chwong server string = sabsd samba server netbios name = sabsd

display charset = CP950 unix charset = CP950 dos charset = CP950

printcap name = /etc/printcap load printers = yes

printing = cups

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

security = user

(15)

Computer Center, CS, NCTU

15

S

S

amba parameters

amba parameters

‰ Default parameters in samba

• %m

¾ Client NetBIOS name

• %M

¾ Client Hostname

• %I

¾ Client IP

• %L

¾ Samba server NetBIOS name

• %h

¾ Samba server Hostname

• %H

¾ User home directory

• %U

¾ Login name

• %T

(16)

Computer Center, CS, NCTU

16

SAMBA configuration file

SAMBA configuration file

Home Sharing Setting (1)

Home Sharing Setting (1)

‰ Home sharing setting

• comment

¾ Description of this directory

• path

¾ Sharing directory path

• browseable

¾ Display sharing name or not

• read only , writeable • write list

¾ Only users on this can write content if read only

• create mode / create mask

¾ Default permission when file is created

• directory mode / directory mask

¾ Default permission when directory is created

(17)

Computer Center, CS, NCTU

17

SAMBA configuration file

SAMBA configuration file

Home Sharing Setting (2)

Home Sharing Setting (2)

‰ Example of home sharing

[Image]

comment = Book Picture path = /home/image read only = no public = yes writable = yes create mode = 0664 directory mode = 0775

(18)

Computer Center, CS, NCTU

18

S

S

tarting SAMBA

tarting SAMBA

‰ Script

(19)

Computer Center, CS, NCTU

19

SAMBA password

SAMBA password

‰ smb password file

• Now samba stores accounts and passwords in tdb

¾ Default database path: /var/db/samba

‰ smbpasswd command

• -a

¾ Add new user

• -d

¾ Let some account in smbpasswd file can not login (to disable)

• -e

(20)

Computer Center, CS, NCTU

20

Tool: smbclient (1)

Tool: smbclient (1)

‰ A client program that can talk to an SMB server

‰ Usage:

• -L [hostname]

¾ List sharable resource

• -U [username]

(21)

Computer Center, CS, NCTU

21

Tool: smbclient (2)

Tool: smbclient (2)

sabsd [/home/chwong] -chwong- smbclient -L sabsd -U chwong Password:

Domain=[SABSD] OS=[Unix] Server=[Samba 3.0.23c] Sharename Type Comment

--- ----

---Image Disk Book Picture

IPC$ IPC IPC Service (sabsd) ADMIN$ IPC IPC Service (sabsd)

Domain=[SABSD] OS=[Unix] Server=[Samba 3.0.23c] Server Comment

--- ---Workgroup Master ---

(22)

---Computer Center, CS, NCTU

22

SWAT (1)

SWAT (1)

‰ Edit /etc/inetd.conf

• Unmark

‰ Restart inetd

‰ Browse http://sabsd.cs.nctu.edu.tw:901/

(23)

Computer Center, CS, NCTU

23

SWAT (2)

SWAT (2)

References

Related documents

-Fieldhouse USA is a $17-million, 144,620 square-foot indoor sports facility and the crown jewel of Sports Village USA.. - It is anticipated that entire village will generate

It is a requirement of this standard that the valves comply with the appropriate valve product British Standards, i.e.: steel wedge gate valves: BS 1414; steel check valves: BS

Just like the process management packs that Microsoft provides for Incident, Problem, Change, and Compliance and Risk Management, the Provance IT Asset Management Pack extends

 Focus on applications, workloads running on virtual machines  Manage, monitor virtual machines just like physical machines  Microsoft System Center Virtual Machine Manager

Figure 2 reports the relative forecast performance of the BC forecasts and the DNS forecasts, assessed using the encompassing test described in detail in Section 3.2. The figure

Having a glazed mullion hand crafted window to the front and side elevation, range of farmhouse style quarter-sawn kitchen units with tiled work surfaces over, peninsular

The most significant enhancement to VoLTE services provided by the EVS codec will be SWB speech (and in-call music) which obviously goes beyond the wideband audio

30(3) An employer shall ensure that no employee is exposed to continuous, intermittent or impact noise in excess of a peak C- weighted level of 140 dB, using a Type 2 sound level