FreeBSD常用操作

最近遇到一些FreeBSD的故障,在这种操作系统上我们平时用的一些命令无法执行,FreeBSD的一些配置文件也和其他很多Linux系统不一样。为了方便以后查阅,我特别整理了这篇文档。

1. 网络

重启网络的命令:

/etc/rc.d/netif restart , /etc/netstart restart

网络配置文件:

root@mhxy-compile02:~ # cat /etc/rc.conf
ifconfig_em0="DHCP"
sshd_enable="NO"
ntpd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
puppet_enable="YES"
ipv6_enable="NO"

hostname="mhxy-compile02.i.nease.net"

nfs_client_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"

2. SSH

命令:

/etc/rc.d/sshd start , /etc/rc.d/sshd restart

SSH配置文件:

root@mhxy-compile02:~ # cat /etc/ssh/sshd_config 
# THIS FILE IS AUTOMATICALLY GENERATED BY PUPPET.
# DO NOT EDIT THIS FILE.

# 1. Basic
Port 32200
Protocol 2


# 2. Authentication
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

KeyRegenerationInterval 3600
ServerKeyBits 768
UsePrivilegeSeparation yes
LoginGraceTime 120

PermitRootLogin no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no

IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no


# 3. Features
UseDNS no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*


# 4. Logging
SyslogFacility AUTH
LogLevel INFO


# 5. x509
Subsystem sftp /usr/libexec/sftp-server
#CACertificateFile /etc/ssh/ca/ca.cer

3. 防火墙

1)停止ipfw防火墙: 
ipfw disable firewall  
/etc/rc.d/ipfw stop

2)开启ipfw防火墙:

ipfw enable firewall  
/etc/rc.d/ipfw start

3)清防火墙
ipf -Fa

4.赋予用户root权限

1)pw groupmod wheel -m 
2)pw user mod  -g wheel

5.查看CPU和内存

1)sysctl kern.smp.cpus或dmesg |grep cpu  #查看CPU个数
2)dmesg|more或top   #查看内存

转载于:https://my.oschina.net/u/3585265/blog/3017198

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值