{"id":137892,"date":"2019-03-02T08:44:02","date_gmt":"2019-03-02T00:44:02","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=137892"},"modified":"2019-02-25T10:23:30","modified_gmt":"2019-02-25T02:23:30","slug":"freebsd-common-operation","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/freebsd-common-operation.html","title":{"rendered":"FreeBSD\u5e38\u7528\u64cd\u4f5c"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u6700\u8fd1\u9047\u5230\u4e00\u4e9bFreeBSD\u7684\u6545\u969c\uff0c\u5728\u8fd9\u79cd\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u6211\u4eec\u5e73\u65f6\u7528\u7684\u4e00\u4e9b\u547d\u4ee4\u65e0\u6cd5\u6267\u884c\uff0cFreeBSD\u7684\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\u4e5f\u548c\u5176\u4ed6\u5f88\u591aLinux\u7cfb\u7edf\u4e0d\u4e00\u6837\u3002\u4e3a\u4e86\u65b9\u4fbf\u4ee5\u540e\u67e5\u9605\uff0c\u6211\u7279\u522b\u6574\u7406\u4e86\u8fd9\u7bc7\u6587\u6863\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1. \u7f51\u7edc<\/strong><\/div>\n

\u91cd\u542f\u7f51\u7edc\u7684\u547d\u4ee4\uff1a<\/p>\n

\/etc\/rc.d\/netif restart , \/etc\/netstart restart<\/pre>\n

\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

root@mhxy-compile02:~ # cat \/etc\/rc.conf\r\nifconfig_em0=\"DHCP\"\r\nsshd_enable=\"NO\"\r\nntpd_enable=\"YES\"\r\n# Set dumpdev to \"AUTO\" to enable crash dumps, \"NO\" to disable\r\ndumpdev=\"AUTO\"\r\nzfs_enable=\"YES\"\r\npuppet_enable=\"YES\"\r\nipv6_enable=\"NO\"\r\n\r\nhostname=\"mhxy-compile02.i.nease.net\"\r\n\r\nnfs_client_enable=\"YES\"\r\nrpc_lockd_enable=\"YES\"\r\nrpc_statd_enable=\"YES\"\r\n<\/pre>\n
2. SSH
\n<\/strong><\/div>\n

\u547d\u4ee4\uff1a<\/p>\n

\/etc\/rc.d\/sshd start , \/etc\/rc.d\/sshd restart<\/pre>\n

SSH\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

root@mhxy-compile02:~ # cat \/etc\/ssh\/sshd_config \r\n# THIS FILE IS AUTOMATICALLY GENERATED BY PUPPET.\r\n# DO NOT EDIT THIS FILE.\r\n\r\n# 1. Basic\r\nPort 32200\r\nProtocol 2\r\n\r\n\r\n# 2. Authentication\r\nHostKey \/etc\/ssh\/ssh_host_rsa_key\r\nHostKey \/etc\/ssh\/ssh_host_dsa_key\r\n\r\nKeyRegenerationInterval 3600\r\nServerKeyBits 768\r\nUsePrivilegeSeparation yes\r\nLoginGraceTime 120\r\n\r\nPermitRootLogin no\r\nStrictModes yes\r\n\r\nRSAAuthentication yes\r\nPubkeyAuthentication yes\r\nPermitEmptyPasswords no\r\nChallengeResponseAuthentication no\r\nPasswordAuthentication no\r\n\r\nIgnoreRhosts yes\r\nRhostsRSAAuthentication no\r\nHostbasedAuthentication no\r\n\r\n\r\n# 3. Features\r\nUseDNS no\r\nX11Forwarding yes\r\nX11DisplayOffset 10\r\nPrintMotd no\r\nPrintLastLog yes\r\nTCPKeepAlive yes\r\nAcceptEnv LANG LC_*\r\n\r\n\r\n# 4. Logging\r\nSyslogFacility AUTH\r\nLogLevel INFO\r\n\r\n\r\n# 5. x509\r\nSubsystem sftp \/usr\/libexec\/sftp-server\r\n#CACertificateFile \/etc\/ssh\/ca\/ca.cer\r\n<\/pre>\n
3. \u9632\u706b\u5899<\/strong><\/div>\n
1)\u505c\u6b62ipfw\u9632\u706b\u5899\uff1a \r\nipfw disable firewall  \r\n\/etc\/rc.d\/ipfw stop\r\n\r\n2)\u5f00\u542fipfw\u9632\u706b\u5899\uff1a\r\n\r\nipfw enable firewall  \r\n\/etc\/rc.d\/ipfw start\r\n\r\n3\uff09\u6e05\u9632\u706b\u5899\r\nipf -Fa\r\n<\/pre>\n
4.\u8d4b\u4e88\u7528\u6237root\u6743\u9650<\/strong><\/div>\n
1\uff09pw groupmod wheel -m \r\n2\uff09pw user mod  -g wheel\r\n<\/pre>\n
5.\u67e5\u770bCPU\u548c\u5185\u5b58<\/strong><\/div>\n
1)sysctl kern.smp.cpus\u6216dmesg |grep cpu  #\u67e5\u770bCPU\u4e2a\u6570\r\n2\uff09dmesg|more\u6216top   #\u67e5\u770b\u5185\u5b58\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u91cd\u542f\u7f51\u7edc\u7684\u547d\u4ee4\uff1a \/etc\/rc.d\/netif restart , \/etc\/netstart restar […]<\/p>\n","protected":false},"author":63,"featured_media":137893,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-137892","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/137892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=137892"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/137892\/revisions"}],"predecessor-version":[{"id":138101,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/137892\/revisions\/138101"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/137893"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=137892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=137892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=137892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}