BSD安装
有用命令
1.重启环境 sh /etc/rc
2.重启网络 /etc/netstart 可能这样也行nerstat -rn
3.Vi操作: a光标输入 r光标开始替换 x删除
按esc退到命令格式后,:w保存:q退出:x保存退出:q!不保存退出
Ctrl +f向末尾翻页 Ctrl+b向页首翻页
4.显示ip ifconfig
重启 shutdown –r now
安装及装mail
1.http://www.jp.freebsd.org/www.FreeBSD.org/where.html下载烧录
2.Boot Menu
选择菜单
3.CD放入。
4.Country Selection
选择国家
5.System Console Keymap
键盘
6.sysinstall Main Menu
安装模式Main Menu
Standard Begin a standard installation (recommended)
7.Message
OK
8.Select Drives(s)
选盘
9.FDISK Partition Editor
格式化
C = Create Slice
D = Delete Slice
Q = Finish
10.Install Boot Manager for drive ad0?
Boot Manager(Standard)
Standard时Boot Manager不要
11.Message
OK
12.FreeBSD Disklabel Editor
A
13.Choose Distribution
拷贝File(ALL)
14.User Confirmation Requested
「Free BSD Ports collection」YES
15.Choose Distribution
拷贝File再显示
X Exit Exit this menu (returning to previous)
16.Choose Installation Media
CD/DVD安装
17.User Confirmation Requested
YES
18.Message
OK
19.User Confirmation Requested
「Ethernet SLIP/PPP Network Device」
No
20.User Confirmation Requested
「Network Gateway」
No
Gateway是才Yes
21.User Confirmation Requested
「Inetd Network Service设定?」
Yes
22.User Confirmation Requested
「Inetd有效?」
Yes
23.User Confirmation Requested
「/etc/inetd.conf上的Editor设置Yes,使用现有设定No」
Yes
使下面有效
*L:9 ftp
*L:10 ftp
*L:15 telnet
*L:16 telnet
*L:30 tftp
*L:31 tftp
1. User Confirmation Requested
「SSH login有效?」
No
2. User Confirmation Requested
「Anonymous FTP access有效?」
No
※Anonymous FTP Server时才YES
3. User Confirmation Requested
「NFS Server有效?」
No
※NFS Server时Yes (/etc/exportfs 必须设定)。
4. User Confirmation Requested
「NFS Client有效?」
No
5. User Confirmation Requested
「System Console设定Customize自定义」
No
6. User Confirmation Requested
7. User Confirmation Requested
「Time Zone有效?」
Yes
8. Select local or UTC (Greenwich Mean Time) clock
「CMOS UTC」
No
9. Time Zone Selector
Asia
10. Countries in Asia
China
11. Confirmation
「CST」
Yes
12. User Confirmation Requested
「Linux binary有效?」
Yes
13. User Confirmation Requested
「System PS/2 Serial Bus Mouse有效?」
PS/2 Serial Bus Mouse有:Yes
PS/2 Serial Bus Mouse无:No
No
14. User Confirmation Requested
「Free BSD Package Collection Browse」
No
15. User Confirmation Requested
「System User Account有效?」
Yes
16. User and group management
User Group有效?
User :User Add a new user to the system
Group :Group Add a new group to the system
User
17. User and group management
「Add a new user」有效?
【例】
*Login ID:Kappa
*Password:Kappa
※Group No40 Group 参照。
18. User and group management
User Group
User:User Add a new user to the system
Group:Group Add a new group to the system
结束:X Exit Exit this menu (returning to previous)
X Exit
19. Message
「”root” Password 」 Message OK
20. 「New Password:」 Password
「Retype New Password:」 Password
21. User Confirmation Requested
「General Configuration Menu」
No
22. sysinstall Main Menu
X Exit Install
23. User Confirmation Requested
Yes
24. Free BSD Shutdown Command (Super user)。
shutdown –h now
System User Account安装
管理员权限登录 su –
rc.conf编辑
cd /
mkdir tftpboot
查IP:ifconfig
获取NetworkInterface名字 第一行左边(例、em0)
vi /etc/rc.conf
inetd_enable="YES"
keymap="jp.106"
linux_enable="YES"
defaultrouter="192.168.0.1"
gateway_enable="YES"
hostname="FreeBSD7-000035.2nd.local"
ifconfig_em0="inet 192.168.0.35 netmask 255.255.0.0"
ipv6_enable="YES"
usbd_enable="YES"
ipv6_network_interfaces="em0"
ipv6_ifconfig_em0="fd36:a7bd:5802:65::35 prefixlen 64"
ipv6_gateway_enable="YES"
ipv6_prefix_em0="fd36:a7bd:5802:65"
ipv6_router_enable="YES"
ipv6_static_routes="local"
ipv6_route_local="fd36:a7bd:5802:64:: -prefixlen 64 fd36:a7bd:5802:65::2"
lpd_enable="YES"
lpd_flags="-1"
named_enable="YES"
Shell编辑
确认shell
cat /etc/shells |grep bash
表示路径就对了不然查找
which bash
如果没有的话
cd /usr/ports/shells/bash
make install
make clean
安装之后在追加路径
echo "/usr/local/bin/bash" >> /etc/shells
chsh –s /usr/local/bin/bash
bind(DNS Server)
cd /usr/ports/dns/bind9/ (bind9可能名字不同)
make configure
make
make install
装完make clean
cd /etc/namedb/
vi named.conf
V6 Server设定
options {
// Relative to the chroot directory, if any
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
query-source-v6 port 53;
listen-on-v6 {any;};
以下注释掉
// listen-on { 127.0.0.1; };
// disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
// disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
// disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
设置DB
zone "2nd.com" {
type master;
file "master/2nd.com.db";
};
保存后
named-checkconf
通过后
vi /etc/namedb/master/2nd.com.db
输入
$TTL 604800
@ IN SOA FreeBSD7-000035.2nd.com. postmaster (
2008031201 ; serial
10800 ; refresh
1800 ; retry
832000 ; expire
86400 ) ; Minmum
IN NS FreeBSD7-000035.2nd.com.
FreeBSD7-000035 IN A 192.168.0.35
FreeBSD7-000035 IN AAAA fd36:a7bd:5802:65::35
redhat8 IN A 192.168.0.2
保存后check
named-checkzone 2nd.com /etc/namedb/mastar/2nd.com.db
再启动
Ping名字不出错
ping FreeBSD7-000035.2nd.com
named.conf修改后可以不启动用这个重加载
rndc reload
Mail Server安装
cd /usr/ports/mail/postfix
make install
Y
Y
make clean
vi /usr/local/etc/postfix/main.cf
70行
myhostname = FreeBSD7-000035.2nd.local
76行
mydomain = 2nd.com
90行
myorigin = $mydomain
107行
inet_interfaces = all
158行
mydestination = $myhostname, localhost.$mydomain, $mydomain
240行
mynetworks_style = subnet
240行
#mynetworks_style = host
290行
relay_domains = $mydestination
380行
alias_maps = hash:/etc/aliases
390行
alias_database = hash:/etc/aliases
最后行
inet_protocols = all
保存退出
追加设定
vi /etc/rc.conf
sendmail_enable="NO"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
qpopper安装
cd /usr/ports/mail/qpopper
make install
make clean
vi /etc/inetd.conf
追加到80行
pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -s
pop3 stream tcp6 nowait root /usr/local/libexec/qpopper qpopper -s
再启动
newaliases
如果不行就用下面的
#cd /usr/ports/mail/postfix
#make instal
#make clean
#vi /usr/local/etc/postfix/main.cf
myhostname = FreeBSD8-000035.2nd.local →76行
mydomain = 2nd.local →83行
myorigin = $mydomain →99行
inet_interfaces = all →113行
mydestination = $myhostname, localhost.$mydomain, loccalhost, $mydomain→161行mynetworks_style = subnet →246行
#mynetworks_style = host →247行
relay_domains = $mydestination →292行
alias_maps = hash:/etc/aliases →382行
alias_database = hash:/etc/aliases →392行
inet_protocols = all
保存结束
#vi /etc/rc.conf
sendmail_enable="NONE"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
postfix_enable="YES"
保存退出
Qpopper安装
#cd /usr/ports/mail/qpopper
#make install
#make clean
#vi /etc/inetd.conf
pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -s
pop3 stream tcp6 nowait root /usr/local/libexec/qpopper qpopper -s
#shutdown -r now
#newaliases
配置服务器的时候用IP就可以了。
端口号110, 25
XXX(用户名)@FreeBSD7-000035.2nd.com
在服务器上
Adduser
无密码就是无模式
有密码就是有模式