FreeBSD学习指南

  发布时间:2008-09-08 18:48:29   作者:佚名   我要评论
FreeBSD 的版本命名规则 A-主要版本编号 B-次要版本编号 C-修正版本编号 TAG-名称标签,如 RELEASE、STABLE、CURRENT install.iso 安装时用这一片即可!mini.iso 也是可以用来安装,但里面没有一些常用的 Package ,所以档案比较小。 硬盘分割表的概念 IDE 硬盘

如果我们要解除所设定的 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;

}

相关文章

  • Unix,BSD,Linux系统三者的区别小结

    这篇文章主要介绍了Unix,BSD,Linux系统三者的区别小结,需要的朋友可以参考下
    2023-05-03
  • FreeBSD如何添加硬盘?FreeBSD添加硬盘的方法

    一些朋友问小编FreeBSD如何添加硬盘?别担心,今天小编就为大家分享FreeBSD添加硬盘的方法,希望对大家会有帮助,有需要的朋友一起去看看吧
    2017-04-06
  • Freebsd PF 安装使用详解

    今天小编为大家带来的是Freebsd PF 安装使用详解,希望对大家会有帮助,有需要的朋友一起去看看吧
    2017-04-06
  • FreeBSD下zfs: failed with error 6错误如何解决?

    最近一些朋友问小编 FreeBSD下zfs: failed with error 6错误如何解决?今天小编要为大家带来的是 FreeBSD下zfs: failed with error 6错误的解决方法,有需要的朋友一起去看
    2017-04-06
  • Unix文件系统和pwd命令实现详解

    今天小编要为大家带来的是Unix文件系统和pwd命令实现详解,希望对大家会有帮助,有需要的朋友一起去看看吧
    2017-04-01
  • Unix中的dot命令详解

    今天小编将为大家带来的是Unix中的dot命令详解!希望对大家会有帮助!有需要的朋友一起去看看吧
    2017-03-22
  • freebsd时间设置小节详解

    近日!一些朋友对于freebsd时间设置小节存在疑虑!下面小编将为大家带来的是freebsd时间设置小节详解!希望对大家会有帮助!有需要的朋友一起去看看吧
    2017-03-19
  • grub2引导freebsd详解

    今天小编要为大家带来的是grub2引导freebsd详解!希望对大家会有帮助,有需要的朋友一起去看看吧
    2017-03-19
  • FreeBSD10安装内核源代码方法讲解

    下面小编为大家带来的是FreeBSD10安装内核源代码方法讲解!希望能够帮助到大家!有需要的朋友一起去看看吧
    2017-03-19
  • FreeBSD下如何使GraphicsMagick支持中文字体?

    最近一些朋友在问FreeBSD下如何使GraphicsMagick支持中文字体?今天小编为大家带来的是FreeBSD下使GraphicsMagick支持中文字体的方法!有需要的朋友一起去看看吧
    2017-03-15

最新评论