当前位置: 移动技术网 > 科技>操作系统>Unix > FreeBSD学习指南

FreeBSD学习指南

2018年03月23日  | 移动技术网科技  | 我要评论
FreeBSD 的版本命名规则 A-主要版本编号 B-次要版本编号 C-修正版本编号 TAG-名称标签,如 RELEASE、STABLE、CURRENT install.iso 安装时用这一片即可!mini.iso 也是可以用来安... 08-09-08

如果我们要解除所设定的 flags ,只要在上述的 flag 之前加上 no 即可,例如 nouchg 。

用法:chflags flags file

flags 的设定只有在 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 中有许多相当有用的文件,值得一读

./configure

make;make install

启动 samba

以 standalone 方式

在 /etc/rc.local 中加入

smbd -d -d1

nmbd -d -d1 -g freebsd -n sambaserver

-d 以 daemon 方式运行

-d1 除错记录型别

-g 显示在 windows 之网络芳邻中的 workgroup 名称

-n samab server 在 workgroup 之内计算机名称。

以 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

设定档设置在 /usr/local/samba/lib/smb.conf

samba 的使用者账号与密码文件位于 /usr/local/samba/private 之中,档名为 smbpasswd ,如果这个档案不存在,samba server 将无法允许任何人登入。建立 smbpasswd 的方法有三种:

一、直接采用 swat 之 password 选单,选取 add new user 来建立。

二、使用 mksmbpasswd.sh 来转换 /etc/passwd 或是账号清单

这种方法直接把 linux / freebsd 的账号密码数据文件转换成 samba 的档案密码数据文件格式,这方法可以很快地把所有在工作站上有账号的使用者都同时在 samba server 使用账号开好。但是您仍旧必须要用 swat 的 password 选单来更改密码。

mksmbpasswd.sh < /etc/passwd > /usr/local/samba/private/smbpasswd

采用 mksmbpasswd.sh 有一个缺点,就是会把 /etc/passwd 中所有的账号,无论是有效或是无效的都转换,所以建置出来的 smbpasswd 会很复杂。

三、

在 windows nt 中,我们可以设定使用者名称及密码。如果在这里设定为 share,就是只使用密码;而设为 user ,则是要输入使用者名称及密码。如果我们设为 user ,client 端在浏览网络芳邻时,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

执行 /usr/sbin/dhcpd

设定档在 /etc/dhcpd.conf

内容:

# 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 ,但要固定某些机器的 ip

在那台机器上 ping dhcp server,在 dhcp server 执行 arp 查出那一台机器的 mac address ,在 /etc/dhcpd.conf 中设定

 host fantasia {

  hardware ethernet 08:00:07:26:c0:a5;

  fixed-address fantasia.fugue.com;

}

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网