歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> 關於Unix

FreeBSD Samba的共享應用


最小代安裝freebsd後,設置好網絡環境

1.新建game文件夾
mkdir /usr/game
cd /usr/game --進入game目錄
2.下載samba源代碼
ftp 192.168.0.200 --登陸FTP
bin --轉換二進制模式
get samba-3.0.23d.tar.gz --使用get命令下載文件
exit
3.解壓並安裝samba
tar zxvf samba-3.0.23d.tar.gz
cd samba-3.0.23d
cd source
./configure --prefix=/usr/local/samba 默認安裝目錄
make
make install
cd ..
cd examples
4.在系統內添加兩個測試帳號,接著將他們加入到samba帳號裡面並設置samba帳號 (重點)
adduser --添加系統賬號 jerry , administrator
Username:jerry --更新游戲賬號
Enter password:
Enter password again:
adduser
Username:administrator --客戶機賬號
Enter password:
Enter password again:

將 jerry , administrator 加入到samba帳號裡面並設置samba帳號
usr/local/samba/bin/smbpasswd -a jerry
New SMB password: -- 一定要和系統密碼相同
Retype new SMB password:
usr/local/samba/bin/smbpasswd -a administrator
New SMB password: -- 一定要和系統密碼相同
Retype new SMB password:

#=Global Settings =
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = workgroup
# server string is the equivalent of the NT Description field
server string = Samba Server
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = user
#=Share Definitions =
[game]
path = /usr/game ;游戲目錄(客戶機,使用administrator,只讀權限)
valid user = administrator ;只允許administrator訪問,
browseable = no ;不顯示共享目錄
[up]
comment = up ;共享名稱,必須加,不然會找不到目錄(游戲更新專用,jerry,可讀/寫權限)
path = /usr/game ;游戲更新目錄
write list = jerry ;只允許jerry修改
invalid users = administrator ;禁止administrator訪問
browseable = no ;不顯示共享目錄
6.建立一個啟動腳本讓系統啟動的時候讓samba服務也一起啟動
ee /etc/rc.d/samba.sh
/usr/local/samba/sbin/smbd start &
/usr/local/samba/sbin/nmbd start &
保存退出
7.設置/usr/game文件夾權限
chmod 777 /usr/game (重要,不然無法寫入文件)

(重啟生效)
Copyright © Linux教程網 All Rights Reserved