Chinaunix首页 | 论坛 | 博客
  • 博客访问: 18681182
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类: BSD

2008-05-05 08:25:21


    • Samba總站:

    • 我的計畫:在FreeBSD上建立/samba資料夾,並將其分享出來。此資料夾對一般使用者(guest)而言是唯讀的。也就是除了將FreeBSD摩擬成網路上的芳鄰外,每位User都能直接存取自己的家目錄。


  1. cd /usr/ports/net/samba
    make BATCH=yes SAMBA_OPTIONS='\"syslog\"' install


      • 編輯 /usr/local/etc/smb.conf
        cd /usr/local/etc
        mv smb.conf.default smb.conf
        • [global]
          workgroup = edu
          # Windows 裡的網路組態中的workgroup設為啥,這裡就設成一樣的內容。
          load printers = no
          security = share
          # 預設值為user,即在Windows端需輸入用戶名稱或通行密碼才能存取Samba的共享資源。
          
          netbios name = samba
          client code page=950
          valid chars = 0xb9
          update encrypted = yes
          hide dot files = yes
          config file = /usr/local/etc/smb.conf
          						

        • [homes]
          comment = Home Directories
          browseable = no
          writable = yes
          						

        • [samba]
          comment = 網路上的芳鄰
          ;此共享資源的文字說明。
          
          path = /samba
          ;共享資源的路徑。
          
          guest ok = yes
          ;無需用戶名稱或通行密碼即可存取共享資源。必須有 security = share 來配合。
          						

      • /etc/services
        將netbios開頭的六行註解起來。
        #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
        				

      • ADD Samba User
        /usr/local/bin/smbpasswd -a UserName PassWord
        				

      • Windows的設定:
        • 網路組態(workgroup)的值請設為「edu」。
        • 若Samba的security = share,任何同一Workgroup的Windows都能看見Samba的共用區。
        • 如果User也使用已在Samba上註冊的帳號、密碼登入Windows,此時就能看見自己在Samba的家目錄。

      • smb.conf 可設定的內容:
        Load smb config files from /usr/local/samba/lib/smb.conf
        Loaded services file OK.
        # Global parameters
        [global]
        	coding system = 
        	client code page = 950
        	workgroup = EDU
        	netbios name = WWW
        	netbios aliases = 
        	netbios scope = 
        	server string = %N (%h) is Samba %v Server.
        	interfaces = 
        	bind interfaces only = No
        	security = USER
        	encrypt passwords = Yes
        	update encrypted = Yes
        	allow trusted domains = Yes
        	hosts equiv = 
        	min password length = 5
        	map to guest = Never
        	null passwords = No
        	password server = 
        	smb passwd file = /usr/local/samba/private/smbpasswd
        	root directory = /
        	passwd program = /bin/passwd
        	passwd chat = *new*password* %n\n *new*password* %n\n *changed*
        	passwd chat debug = No
        	username map = 
        	password level = 0
        	username level = 0
        	unix password sync = No
        	restrict anonymous = No
        	use rhosts = No
        	debug level = 2
        	syslog = 1
        	syslog only = No
        	log file = /usr/local/samba/var/log.%m
        	max log size = 5000
        	debug timestamp = Yes
        	debug hires timestamp = No
        	debug pid = No
        	debug uid = No
        	protocol = NT1
        	read bmpx = No
        	read raw = Yes
        	write raw = Yes
        	nt smb support = Yes
        	nt pipe support = Yes
        	nt acl support = Yes
        	announce version = 4.2
        	announce as = NT
        	max mux = 50
        	max xmit = 65535
        	name resolve order = lmhosts host wins bcast
        	max ttl = 259200
        	max wins ttl = 518400
        	min wins ttl = 21600
        	time server = No
        	change notify timeout = 60
        	deadtime = 0
        	getwd cache = Yes
        	keepalive = 300
        	lpq cache time = 10
        	max disk size = 0
        	max open files = 10000
        	read prediction = No
        	read size = 16384
        	shared mem size = 1048576
        	socket options = TCP_NODELAY
        	stat cache size = 50
        	load printers = No
        	printcap name = /etc/printcap
        	printer driver file = /usr/local/samba/lib/printers.def
        	strip dot = No
        	character set = 
        	mangled stack = 50
        	stat cache = Yes
        	domain groups = 
        	domain admin group = 
        	domain guest group = 
        	domain admin users = 
        	domain guest users = 
        	machine password timeout = 604800
        	add user script = 
        	delete user script = 
        	logon script = 
        	logon path = \\%N\%U\profile
        	logon drive = 
        	logon home = \\%N\%U
        	domain logons = No
        	os level = 20
        	lm announce = Auto
        	lm interval = 60
        	preferred master = No
        	local master = Yes
        	domain master = No
        	browse list = Yes
        	dns proxy = No
        	wins proxy = No
        	wins server = 
        	wins support = No
        	wins hook = 
        	kernel oplocks = Yes
        	ole locking compatibility = Yes
        	oplock break wait time = 10
        	smbrun = /usr/local/samba/bin/smbrun
        	config file = /usr/local/samba/lib/smb.conf
        	auto services = 
        	lock directory = /usr/local/samba/var/locks
        	default service = 
        	message command = 
        	dfree command = 
        	valid chars = 
        	remote announce = 
        	remote browse sync = 
        	socket address = 0.0.0.0
        	homedir map = 
        	time offset = 0
        	unix realname = No
        	NIS homedir = No
        	source environment = 
        	panic action = 
        	comment = 
        	path = 
        	revalidate = No
        	username = 
        	guest account = nobody
        	invalid users = 
        	valid users = 
        	admin users = 
        	read list = 
        	write list = 
        	force user = 
        	force group = 
        	writeable = No
        	create mask = 0744
        	force create mode = 00
        	security mask = -1
        	force security mode = -1
        	directory mask = 0755
        	force directory mode = 00
        	directory security mask = -1
        	force directory security mode = -1
        	inherit permissions = No
        	guest only = No
        	guest ok = No
        	only user = No
        	hosts allow = 
        	hosts deny = 
        	status = Yes
        	max connections = 0
        	min print space = 0
        	strict sync = No
        	sync always = No
        	write cache size = 0
        	printable = No
        	postscript = No
        	printing = bsd
        	print command = lpr -r -P%p %s
        	lpq command = lpq -P%p
        	lprm command = lprm -P%p %j
        	lppause command = 
        	lpresume command = 
        	queuepause command = 
        	queueresume command = 
        	printer = 
        	printer driver = NULL
        	printer driver location = 
        	default case = lower
        	case sensitive = No
        	preserve case = Yes
        	short preserve case = Yes
        	mangle case = No
        	mangling char = ~
        	hide dot files = Yes
        	delete veto files = No
        	veto files = 
        	hide files = 
        	veto oplock files = 
        	map system = No
        	map hidden = No
        	map archive = Yes
        	mangled names = Yes
        	mangled map = 
        	browseable = Yes
        	blocking locks = Yes
        	fake oplocks = No
        	locking = Yes
        	oplocks = Yes
        	level2 oplocks = No
        	oplock contention limit = 2
        	strict locking = No
        	share modes = Yes
        	copy = 
        	include = 
        	preexec = 
        	preexec close = No
        	postexec = 
        	root preexec = 
        	root preexec close = No
        	root postexec = 
        	available = Yes
        	volume = 
        	fstype = NTFS
        	set directory = No
        	wide links = Yes
        	follow symlinks = Yes
        	dont descend = 
        	magic script = 
        	magic output = 
        	delete readonly = No
        	dos filetimes = No
        	dos filetime resolution = No
        	fake directory create times = No
        				


      • security:Samba的安全等級。
        共有四種。
        • share
          使用者不需要帳號及密碼即可登入Samba伺服器。
        • user
          Samba伺服器預設的安全等級。使用者需要有帳號及密碼才能登入Samba伺服器。檢查帳號及密碼的工作即由提供本服務的Samba伺服器負責。
        • server
          檢查帳號及密碼的工作是由另一台(可以是Windows NT/2000 或 Samba)伺服器負責。
          password server = serverName ← 設定要驗證密碼的主機
          smb passwd file = /path/to/remote_smbpasswd ← 指定 passwd server 存放密碼檔的位置。
        • domain

    阅读(1337) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~