FreeBSD學(xué)習(xí)指南

如果我們要解除所設(shè)定的 flags ,只要在上述的 flag 之前加上 no 即可,例如 nouchg 。
用法:chflags flags file
flags 的設(shè)定只有在 Kernel Security Level 為 -1 或 0 時才可以被更改。如果 Security Level 為 1 或 2 時就不能更動 flags 了。
FreeBSD 下的 Samba Server
tar -xvzf samba-2.2.7.tar.gz
cd samba-2.2.7/source
docs 中有許多相當(dāng)有用的文件,值得一讀
./configure
make;make install
啟動 Samba
以 Standalone 方式
在 /etc/rc.local 中加入
smbd -D -d1
nmbd -D -d1 -G FreeBSD -n SambaServer
-D 以 Daemon 方式運行
-d1 除錯記錄型別
-G 顯示在 Windows 之網(wǎng)絡(luò)芳鄰中的 Workgroup 名稱
-n Samab Server 在 Workgroup 之內(nèi)計算機(jī)名稱。
以 Inetd 方式啟動
修改 /etc/services ,檢查是否有底下二行存在
netbios-ssn 139/tcp
netbios-ns 137/udp
/etc/inetd.conf 是否有以下二行存在
netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
設(shè)定檔設(shè)置在 /usr/local/samba/lib/smb.conf
Samba 的使用者賬號與密碼文件位于 /usr/local/samba/private 之中,檔名為 smbpasswd ,如果這個檔案不存在,Samba Server 將無法允許任何人登入。建立 smbpasswd 的方法有三種:
一、直接采用 SWAT 之 PASSWORD 選單,選取 Add New User 來建立。
二、使用 mksmbpasswd.sh 來轉(zhuǎn)換 /etc/passwd 或是賬號清單
這種方法直接把 Linux / FreeBSD 的賬號密碼數(shù)據(jù)文件轉(zhuǎn)換成 Samba 的檔案密碼數(shù)據(jù)文件格式,這方法可以很快地把所有在工作站上有賬號的使用者都同時在 Samba Server 使用賬號開好。但是您仍舊必須要用 SWAT 的 PASSWORD 選單來更改密碼。
mksmbpasswd.sh < /etc/passwd > /usr/local/samba/private/smbpasswd
采用 mksmbpasswd.sh 有一個缺點,就是會把 /etc/passwd 中所有的賬號,無論是有效或是無效的都轉(zhuǎn)換,所以建置出來的 smbpasswd 會很復(fù)雜。
三、
在 Windows NT 中,我們可以設(shè)定使用者名稱及密碼。如果在這里設(shè)定為 share,就是只使用密碼;而設(shè)為 user ,則是要輸入使用者名稱及密碼。如果我們設(shè)為 user ,Client 端在瀏覽網(wǎng)絡(luò)芳鄰時,Windows 會自動輸入使用者名稱為登入 Windows 時所用的名稱,我們必須在 Samba 中加入相對的使用者密碼。
For Traditional Chiese User
client code page=950
;coding system=cap
valid chars=0xb9
FreeBSD 下的 DHCP Server
tar -xvzf dhcp-3.0pl1.tar.gz
cd dhcp-3.0pl1
./configure
make all;make install
執(zhí)行 /usr/sbin/dhcpd
設(shè)定檔在 /etc/dhcpd.conf
內(nèi)容:
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
ddns-update-style ad-hoc;
# option definitions common to all supported networks...
option domain-name "tces.ilc.edu.tw";
option domain-name-servers 140.111.152.3, 140.111.66.1, 140.111.66.10;
# ddns-update-style;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
subnet 140.111.152.0 netmask 255.255.255.0 {
range 140.111.152.50 140.111.152.100;
option domain-name-servers 140.111.152.3, 140.111.66.1, 140.111.66.10;
option domain-name "tces.ilc.edu.tw";
option routers 140.111.152.254;
option broadcast-address 140.111.152.255;
default-lease-time 600;
max-lease-time 7200;
}
# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
host passacaglia {
hardware ethernet 0:0:c0:5d:bd:95;
filename "vmunix.passacaglia";
server-name "toccata.fugue.com";
}
# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
host fantasia {
hardware ethernet 08:00:07:26:c0:a5;
fixed-address fantasia.fugue.com;
}
touch /var/db/dhcpd.leases
用 DHCP Server 分配 IP ,但要固定某些機(jī)器的 IP
在那臺機(jī)器上 Ping DHCP Server,在 DHCP Server 執(zhí)行 arp 查出那一臺機(jī)器的 Mac Address ,在 /etc/dhcpd.conf 中設(shè)定
host fantasia {
hardware ethernet 08:00:07:26:c0:a5;
fixed-address fantasia.fugue.com;
}
相關(guān)文章
Unix,BSD,Linux系統(tǒng)三者的區(qū)別小結(jié)
這篇文章主要介紹了Unix,BSD,Linux系統(tǒng)三者的區(qū)別小結(jié),需要的朋友可以參考下2023-05-03- 一些朋友問小編FreeBSD如何添加硬盤?別擔(dān)心,今天小編就為大家分享FreeBSD添加硬盤的方法,希望對大家會有幫助,有需要的朋友一起去看看吧2017-04-06
- 今天小編為大家?guī)淼氖荈reebsd PF 安裝使用詳解,希望對大家會有幫助,有需要的朋友一起去看看吧2017-04-06
FreeBSD下zfs: failed with error 6錯誤如何解決?
最近一些朋友問小編 FreeBSD下zfs: failed with error 6錯誤如何解決?今天小編要為大家?guī)淼氖?FreeBSD下zfs: failed with error 6錯誤的解決方法,有需要的朋友一起去看2017-04-06Unix文件系統(tǒng)和pwd命令實現(xiàn)詳解
今天小編要為大家?guī)淼氖荱nix文件系統(tǒng)和pwd命令實現(xiàn)詳解,希望對大家會有幫助,有需要的朋友一起去看看吧2017-04-01- 今天小編將為大家?guī)淼氖荱nix中的dot命令詳解!希望對大家會有幫助!有需要的朋友一起去看看吧2017-03-22
- 近日!一些朋友對于freebsd時間設(shè)置小節(jié)存在疑慮!下面小編將為大家?guī)淼氖莊reebsd時間設(shè)置小節(jié)詳解!希望對大家會有幫助!有需要的朋友一起去看看吧2017-03-19
- 今天小編要為大家?guī)淼氖莋rub2引導(dǎo)freebsd詳解!希望對大家會有幫助,有需要的朋友一起去看看吧2017-03-19
- 下面小編為大家?guī)淼氖荈reeBSD10安裝內(nèi)核源代碼方法講解!希望能夠幫助到大家!有需要的朋友一起去看看吧2017-03-19
FreeBSD下如何使GraphicsMagick支持中文字體?
最近一些朋友在問FreeBSD下如何使GraphicsMagick支持中文字體?今天小編為大家?guī)淼氖荈reeBSD下使GraphicsMagick支持中文字體的方法!有需要的朋友一起去看看吧2017-03-15