亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
樓主: king_819
打印 上一主題 下一主題

Linux/unix安全優(yōu)化的討論與案例分享(獲獎名單已公布) [復(fù)制鏈接]

論壇徽章:
381
CU十二周年紀(jì)念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大;照
日期:2013-03-13 15:38:15CU大;照
日期:2013-03-13 15:38:52CU大;照
日期:2013-03-14 14:08:55CU大;照
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大;照
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大;照
日期:2013-04-17 11:17:56
11 [報告]
發(fā)表于 2012-03-08 15:13 |只看該作者
本帖最后由 chenyx 于 2012-03-08 15:17 編輯

另外,ssh服務(wù)應(yīng)該加固,ssh協(xié)議只用協(xié)議2,采用key的方式登錄,禁止密碼登陸以及root登陸,除了key方式以外的認(rèn)證方式一律禁止.

論壇徽章:
0
12 [報告]
發(fā)表于 2012-03-08 15:17 |只看該作者
本帖最后由 king_819 于 2012-03-08 15:24 編輯

    先來貼一個關(guān)于freebsd系統(tǒng)的內(nèi)核優(yōu)化,freebsd系統(tǒng)相對于linux類的系統(tǒng),內(nèi)核已經(jīng)算是很簡潔了,但為了發(fā)揮它高效的性能,所以決定再對它的內(nèi)核進行精簡

一、內(nèi)核編譯


   優(yōu)化內(nèi)核,去掉不用的組件及設(shè)備驅(qū)動,以提高系統(tǒng)效率,首先使用uname -a查看本機的內(nèi)核詳細版本,使用dmesg查看

本機所有的硬件信息,并進行相應(yīng)的記錄,后續(xù)編輯內(nèi)核文件時要用到
1.安裝CVSUP:


最好在安裝時裝好cvsup;
freebsd# cd /usr/ports/net/cvsup-without-gui/
freebsd# make install clean


2.升級源碼:


freebsd# ee /usr/share/examples/cvsup/stable-supfile
把:
default host=CHANGE_THIS.FreeBSD.org
改為:
default host=cvsup.FreeBSDchina.org
src-all
freebsd# ee /usr/share/examples/cvsup/ports-supfile
把:
default host=CHANGE_THIS.FreeBSD.org
改為:
default host=cvsup.FreeBSDchina.org
freebsd# cvsup -g -L 2 /usr/share/examples/cvsup/stable-supfile
或者  csup -g -L 2 /usr/share/examples/cvsup/stable-supfile
freebsd# cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile
freebsd# cd /usr/obj
freebsd# chflags -R noschg *
freebsd# rm -rf *


3.重新編譯源碼和內(nèi)核


freebsd# cd /usr/src/sys/amd64(或i386---32位與64位,分別選擇相應(yīng)的)/conf/
freebsd# mkdir /root/kernels
freebsd# cp GENERIC /root/kernels/MYKERNEL
freebsd# cd /usr/src
freebsd# ln -s /root/kernels/MYKERNEL
freebsd# make buildworld    //編譯所有的系統(tǒng)程序
freebsd# make buildkernel KERNCONF=MYKERNEL   //編譯新的系統(tǒng)核心
freebsd# reboot
freebsd# make installkernel KERNCONF=MYKERNEL  //安裝新的系統(tǒng)核心
freebsd# make installworld   //安裝新的系統(tǒng)程序
freebsd# reboot
重啟系統(tǒng)用uname -a查看編輯后的內(nèi)核是否是自己定制的內(nèi)核;


編輯內(nèi)核文件要注意的地方
device  em    # Broadcom BCM570xx Gigabit Ethernet  //加載網(wǎng)卡,一定要慎重,特別是遠程
如果不確定網(wǎng)卡型號,可用dmesg |less 查看

如新內(nèi)核有問題,可以還的原內(nèi)核文件
mv /boot/kernel /boot/kernel.bak
mv /boot/kernel.old /boot/kernel



4、附上生產(chǎn)環(huán)境中優(yōu)化后的內(nèi)核文件:
  1. cpu  I686_CPU
  2. ident  MYKERNE

  3. device          pf
  4. device          pflog
  5. device          pfsync
  6. options         ALTQ
  7. options         ALTQ_CBQ
  8. options         ALTQ_RED
  9. options         ALTQ_RIO
  10. options         ALTQ_HFSC
  11. options         ALTQ_PRIQ
  12. options         ALTQ_NOPCC
  13. options         SC_DISABLE_REBOOT

  14. options         IPFIREWALL                           
  15. options         IPFIREWALL_DEFAULT_TO_ACCEPT         
  16. options         DUMMYNET                              
  17. options         HZ=1000

  18. options   IPSEC        #IP security
  19. device    crypto

  20. options  SCHED_ULE  # ULE scheduler
  21. options  PREEMPTION  # Enable kernel thread preemption
  22. options  INET   # InterNETworking
  23. options  SCTP   # Stream Control Transmission Protocol
  24. options  FFS   # Berkeley Fast Filesystem
  25. options  SOFTUPDATES  # Enable FFS soft updates support
  26. options  UFS_ACL   # Support for access control lists
  27. options  UFS_DIRHASH  # Improve performance on big directories
  28. options  UFS_GJOURNAL  # Enable gjournal-based UFS journaling
  29. options  MD_ROOT   # MD is a potential root device
  30. options  PROCFS   # Process filesystem (requires PSEUDOFS)
  31. options  PSEUDOFS  # Pseudo-filesystem framework
  32. options  COMPAT_43TTY  # BSD 4.3 TTY compat [KEEP THIS!]
  33. options  SCSI_DELAY=5000  # Delay (in ms) before probing SCSI
  34. options  KTRACE   # ktrace(1) support
  35. options  STACK   # stack(9) support
  36. options  SYSVSHM   # SYSV-style shared memory
  37. options  SYSVMSG   # SYSV-style message queues
  38. options  SYSVSEM   # SYSV-style semaphores
  39. options  P1003_1B_SEMAPHORES # POSIX-style semaphores
  40. options  _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
  41. options  KBD_INSTALL_CDEV # install a CDEV entry in /dev
  42. options  ADAPTIVE_GIANT  # Giant mutex is adaptive.
  43. options  STOP_NMI  # Stop CPUS using NMI instead of IPI
  44. options  AUDIT   # Security event auditing

  45. # To make an SMP kernel, the next two lines are needed
  46. options  SMP   # Symmetric MultiProcessor Kernel
  47. device  apic   # I/O APIC

  48. # CPU frequency control
  49. device  cpufreq

  50. # Bus support.
  51. device  eisa
  52. device  pci

  53. # SCSI Controllers
  54. device  mpt  # LSI-Logic MPT-Fusion
  55. device  scbus  # SCSI bus (required for SCSI)
  56. device  ch  # SCSI media changers
  57. device  da  # Direct Access (disks)
  58. device  pass  # Passthrough device (direct SCSI access)
  59. device  ses  # SCSI Environmental Services (and SAF-TE)

  60. # atkbdc0 controls both the keyboard and the PS/2 mouse
  61. device  atkbdc  # AT keyboard controller
  62. device  atkbd  # AT keyboard
  63. device  psm  # PS/2 mouse

  64. device  vga  # VGA video card driver

  65. device  splash  # Splash screen and screen saver support

  66. # syscons is the default console driver, resembling an SCO console
  67. device  sc

  68. device  agp  # support several AGP chipsets

  69. # Power management support (see NOTES for more options)
  70. #device  apm
  71. # Add suspend/resume support for the i8254.
  72. device  pmtimer

  73. # PCI Ethernet NICs that use the common MII bus controller code.
  74. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
  75. device  miibus  # MII bus support
  76. device  em
  77. device  le  # Broadcom BCM570xx Gigabit Ethernet


  78. # Pseudo devices.
  79. device  loop  # Network loopback
  80. device  random  # Entropy device
  81. device  ether  # Ethernet support
  82. device  tun  # Packet tunnel.
  83. device  pty  # Pseudo-ttys (telnet etc)
  84. device  md  # Memory "disks"
  85. device  gif  # IPv6 and IPv4 tunneling
  86. device  bpf  # Berkeley packet filter

  87. # USB support
  88. device  uhci  # UHCI PCI->USB interface
  89. device  ohci  # OHCI PCI->USB interface
  90. device  ehci  # EHCI PCI->USB interface (USB 2.0)
  91. device  usb  # USB Bus (required)
  92. device  ukbd  # Keyboard
復(fù)制代碼

論壇徽章:
0
13 [報告]
發(fā)表于 2012-03-08 15:21 |只看該作者
本帖最后由 king_819 于 2012-03-08 15:29 編輯
chenyx 發(fā)表于 2012-03-08 15:13
另外,ssh服務(wù)應(yīng)該加固,ssh協(xié)議只用協(xié)議2,采用key的方式登錄,禁止密碼登陸以及root登陸,除了key方式以外的認(rèn) ...



ssh用key認(rèn)證,再配合上sudo

論壇徽章:
0
14 [報告]
發(fā)表于 2012-03-08 15:22 |只看該作者
本帖最后由 king_819 于 2012-03-08 15:29 編輯
chenyx 發(fā)表于 2012-03-08 15:13
另外,ssh服務(wù)應(yīng)該加固,ssh協(xié)議只用協(xié)議2,采用key的方式登錄,禁止密碼登陸以及root登陸,除了key方式以外的認(rèn) ...



ssh用key認(rèn)證,再配合上sudo

論壇徽章:
381
CU十二周年紀(jì)念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大;照
日期:2013-03-13 15:38:15CU大;照
日期:2013-03-13 15:38:52CU大;照
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大;照
日期:2013-04-17 11:17:32CU大;照
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
15 [報告]
發(fā)表于 2012-03-08 15:22 |只看該作者
回復(fù) 14# king_819


    sudo,不是sodu

論壇徽章:
0
16 [報告]
發(fā)表于 2012-03-08 15:25 |只看該作者
回復(fù) 15# chenyx

呵呵。。打反了


   

論壇徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大;照
日期:2013-03-13 15:29:49CU大;照
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
17 [報告]
發(fā)表于 2012-03-08 15:34 |只看該作者
目前遇到的安全問題,大都集中在弱口令上。
高端的黑客攻擊基本沒遇到過,內(nèi)核提權(quán)之類的也沒遇到過。

論壇徽章:
4
CU大;照
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大;照
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
18 [報告]
發(fā)表于 2012-03-08 15:35 |只看該作者
自己編譯的內(nèi)核需要及時關(guān)注內(nèi)核的安全更新,畢竟防患于未然。性能有提升,但增加了維護的工作量。

論壇徽章:
18
巳蛇
日期:2014-12-03 08:27:5115-16賽季CBA聯(lián)賽之吉林
日期:2016-04-18 15:24:24qiaoba
日期:2016-06-17 17:41:1615-16賽季CBA聯(lián)賽之八一
日期:2016-06-20 15:13:1415-16賽季CBA聯(lián)賽之廣夏
日期:2016-06-29 10:38:28極客徽章
日期:2016-12-07 14:03:4015-16賽季CBA聯(lián)賽之吉林
日期:2017-03-06 13:47:55
19 [報告]
發(fā)表于 2012-03-08 15:45 |只看該作者
ssh更改端口,用key登錄
sudo感覺就是個怪東西

論壇徽章:
0
20 [報告]
發(fā)表于 2012-03-08 16:04 |只看該作者
chenyx 發(fā)表于 2012-03-08 15:07
系統(tǒng)安全,有個原則,就是只開放必要的端口,其他的端口一律不開放.比如一個web服務(wù),我們只開放22和80端口


這個防護還不夠嚴(yán)格
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP