新西兰服务器

FreeBSD常用操作有哪些


FreeBSD常用操作有哪些

发布时间:2022-02-18 17:23:49 来源:高防服务器网 阅读:69 作者:iii 栏目:开发技术

这篇“FreeBSD常用操作有哪些”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“FreeBSD常用操作有哪些”文章吧。

1. 网络

重启网络的命令:

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

网络配置文件:

root@mhxy-compile02:~ # cat /etc/rc.confifconfig_em0="DHCP"sshd_enable="NO"ntpd_enable="YES"# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disabledumpdev="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. BasicPort 32200  Protocol 2# 2. AuthenticationHostKey /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. FeaturesUseDNS no  X11Forwarding yes  X11DisplayOffset 10  PrintMotd no  PrintLastLog yes  TCPKeepAlive yes  AcceptEnv LANG LC_*# 4. LoggingSyslogFacility AUTH  LogLevel INFO# 5. x509Subsystem 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   #查看内存

以上就是关于“FreeBSD常用操作有哪些”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注高防服务器网行业资讯频道。

[微信提示:高防服务器能助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

[图文来源于网络,不代表本站立场,如有侵权,请联系高防服务器网删除]
[