在/etc/ssh/sshd_config中添加
DenyUsers root@”!10.1.0.0/16,*”
表示禁止root用户从除10.1网段以外的其它IP登陆
在/etc/ssh/sshd_config中添加
DenyUsers root@”!10.1.0.0/16,*”
表示禁止root用户从除10.1网段以外的其它IP登陆
正确的方法是:
sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 sed -i '/net.ipv6.conf.all.disable_ipv6=/d' /etc/sysctl.conf echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf sed -i '/net.ipv6.conf.default.disable_ipv6=/d' /etc/sysctl.conf echo "net.ipv6.conf.default.disable_ipv6=1" >> /etc/sysctl.conf
/etc/ssh/sshd_conf中的AddressFamily any改为AddressFamily inet,否则sshd会有问题
/etc/modprobe.d/ 目录下新建一个文件,内容为install ipv6 /bin/true,的确能关闭IPv6但是会导致网卡bonding失败等各种问题
/etc/sysconfig/network 里面添加NETWORKING_IPV6=no 或者 IPV6INIT=no 都是没有用的
FreeBSD升级后,添加用户出错adduser: ERROR: There was an error adding user
需要:
zpool upgrade -a
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
比如hp的dl380g5服务器,raid的逻辑盘在linux中不是/dev/sda而是/dev/cciss/c0d0,mmcrnsd的时候正常,但是mmcrfs的时候报错“Unable to open disk”,使用mmlsnsd -m则有如下显示:
Disk name NSD volume ID Device Node name Remarks
—————————————————————————————
io00nsd01 0A01C866666C04EB – io00 (not found) server node
解决方法:
cp /usr/lpp/mmfs/samples/nsddevices.sample /var/mmfs/etc/nsddevices
vim /var/mmfs/etc/nsddevices
在$osName = Linux 增加 echo "/dev/cciss/c0d0p4 generic",取消最后return 1的注释,echo中的/dev/cciss/c0d0p4必须和你的nsd描述文件中的device完全一致
chmod +x /var/mmfs/etc/nsddevices
测试环境:IBM HS22 X5650 24Gram Chelsio T420-BCH 关闭超线程 两台,BNT Virtual Fabric 10Gb Switch Module for IBM BladeCenter 两台,RHEL 6.3,ChelsioUwire-2.2.0.0,iperf 2.0.5 (08 Jul 2010) pthreads
详细测试结果见下面的表格,显而易见,万兆TOE还是非常有必要的,否则光对10GB的TCP流量进行基本处理就耗尽CPU资源了。
升级说明中有一点要求是:Please rebuild all installed 3rd party software
应该执行的命令是:portmaster -Raf
对于ZFS root的系统,升级完成重启前需要重写所有的硬盘的boot
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
samba报错smbd’s max open files = 16384
一般是系统的open flies限制
查看系统限制:
[root@storage ~]# sysctl -a | grep maxfiles
kern.maxfiles: 12328
kern.maxfilesperproc: 11095
kern.openfiles: 8760
FreeBSD 8.2,默认系统打开文件数12328,每进程打开文件数11095,kern.openfiles是系统当前打开文件数。
设置新的系统限制:
[root@storage ~]# sysctl kern.maxfiles=65536
[root@storage ~]# sysctl kern.maxfilesperproc=32768
查看某个进程的系统限制,nofile就是这个进程打开文件数的限制
24443是某个smbd的pid
[root@storage ~]# mount -t procfs proc /proc
[root@storage ~]# cd /proc/24443
[root@storage /proc/24443]# ls -l
total 0
-r–r–r– 1 root wheel 0 Nov 7 20:15 cmdline
———- 1 root wheel 0 Nov 7 20:15 ctl
———- 1 root wheel 0 Nov 7 20:15 dbregs
-r–r–r– 1 root wheel 0 Nov 7 20:15 etype
lr–r–r– 1 root wheel 0 Nov 7 20:15 file -> /usr/local/sbin/smbd
———- 1 root wheel 0 Nov 7 20:15 fpregs
-r–r–r– 1 root wheel 0 Nov 7 20:15 map
———- 1 root wheel 0 Nov 7 20:15 mem
———- 1 root wheel 0 Nov 7 20:15 note
———- 1 root wheel 0 Nov 7 20:15 notepg
———- 1 root wheel 0 Nov 7 20:15 osrel
———- 1 root wheel 0 Nov 7 20:15 regs
-r–r–r– 1 root wheel 0 Nov 7 20:15 rlimit
-r–r–r– 1 root wheel 0 Nov 7 20:15 status
[root@storage /proc/24443]# cat rlimit
cpu -1 -1
fsize -1 -1
data 34359738368 34359738368
stack 536870912 536870912
core -1 -1
rss -1 -1
memlock -1 -1
nproc 5547 5547
nofile 32768 32768
sbsize -1 -1
vmem -1 -1
npts -1 -1
swap -1 -1
/etc/login.conf可以配置某个用户的系统资源限制,默认是无限制的,就是受限于系统内核限制
/etc/sysctl.conf里面配置对开机启动的服务无效
/boot/loader.conf里面配置对开机启动的服务有效
debian 6.0.0 安装的时候只选了Standard system utilities,虽然在安装过程中不认识vmxnet3网卡,但是安装完成后即使没有安装VMware Tools,debian也是可以识别vmxnet3网卡的。
编辑/etc/apt/sources.list,把原来的都注释了,加入下面的内容
deb http://ftp.cn.debian.org/debian squeeze main
deb-src http://ftp.cn.debian.org/debian squeeze main
deb http://ftp.cn.debian.org/debian squeeze-updates main
deb-src http://ftp.cn.debian.org/debian squeeze-updates main
deb http://mirrors.ustc.edu.cn/debian-security/ squeeze/updates main
deb-src http://mirrors.ustc.edu.cn/debian-security/ squeeze/updates main
在安装VMware Tools之前还需要执行 aptitude install make linux-headers-2.6-amd64 来安装gcc make linux-headers等,可喜的是这些都在CD1上就有。
安装mysql的不要忘记运行一下mysql_secure_installation
домейнYou need base, sys, and sbin sources if you are going the sysinstall route. If you look in the fusefs-kmod Makefile:
显示当前目录下的所有目录 ls -d */
显示/dev下的所有目录 ls -d /dev/*/
神奇啊