关闭

linux skills(pending)

352人阅读 评论(0) 收藏 举报
 

HTML Tags and JavaScript tutorial



linux skills(pending)





building linux kernel sources
uname -r
rpm -ivh kernel-2.6.11-1.1369_FC4.src.rpm
rpmbuild -bp --target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec
cd /usr/src
mv /usr/src/redhat/BUILD/kernel-2.6.11/linux-2.6.11 /usr/src/linux-2.6.11
ln -s linux-2.6.11 linux
-----------------------------------------------------------------------------------------------------------
启动httpd
service httpd start|stop|restart
缺省网页路径
/var/www/html
php.ini路径(修改网页间变量值传递global??为ON)
/etc
-----------------------------------------------------------------------------------------------------------
启动mysql
/etc/init.d
mysqld start
-----------------------------------------------------------------------------------------------------------
启动tftp
/usr/sbin/in.tftpd -l -a 10.46.1.170:69 -s /tftpboot
-----------------------------------------------------------------------------------------------------------
NFS如何建立
Server:
vi /etc/exports
/vob    *(rw,sync)
/etc/rc.d/init.d/portmap start (在REDHAT中PORTMAP是默认启动的)
/etc/rc.d/init.d/nfs start
exportfs -a
Client:
rpm -ivh nfs-utils-1.0.7-8.i386.rpm
mount -t nfs hostname(orIP):/directory /mount/point
检测手段
nfsstat
rpcinfo
showmount –e IP
-----------------------------------------------------------------------------------------------------------
问:telnet后很长时间才出现登录画面,但是登录后速度并不慢,原因是什么?
答:这个问题的根本原因是: 反向域名解析!
简单解决办法:
vi /etc/resolv.conf
search localdomain
nameserver 172.19.30.63
nameserver 172.19.30.64
受反向域名 解析影响初始连接速度的应用有telnet,ftp, 而www,proxy要看配置中DNS是否许可。受影响程度与本地LAN与Internet连接的速度有关, 当你用 9600bps的X.25(or DDN)与ISP连接的话, 那么这个问题会更加明显。
这个问题的解释: 
unix主机上诸如telnetd,ftpd,logind 这内的服务程序, 通常在接受连接时试图知道客户机IP对应的域名, 它当然会查询本地dns server, dns server 或者会回答unix主机以客户机的域名,或者会通知unix主机客户机没有域名, 或者查询超时.. 当客户机IP在本地dns server上没有反向域名记录时, dns server 与外界联系是必须的.. 本地LAN与Internet连接的速度当然会影响到反向域名解析, 最糟糕的情况是telnetd等服务程序要等到反向域名解析超时才会做下一步的工作。
解决办法:
由于抱怨通常是来自内部的, 更何况你能管的也只有内部这个网络。我的做法是: 给内部网络的每个IP都加上反向域名记录, 可是问题又出来了并非每个IP都有域名啊?!
域名解析和反向域名解析并非镜像的关系,你大可以有这样的一个反向域的配置文件:
1.168.192.in-addr.arpa  IN  SOA  dns.xxxx.com.cn. xxxx.xxx.xxx.com.cn. (
884107551               ; Serial Number
10800                   ; Refresh after 3 hours
3600                    ; Retry after 1 hour
604800                  ; Expire after 1 week
86400 )                 ; Minimum TTL of 1 day                 
1       IN      PTR     192.168.1.1.
2       IN      PTR     192.168.1.2.
这样做,情况就好多了.. 不过一些站点有域名验证的(用反向域名解析查到的域名再正向解析一次,看看IP对不对),你就进不去了。
如何重起telnet?
:service xinetd restart
0012 让root直接telnet登陆(bjchenxu)
编辑/etc/pam.d/login,去掉
auth required /lib/security/pam_securetty.so 这句话
好像不起作用?
这样修改可以成功:
mv /etc/securetty /etc/securetty.bak
-----------------------------------------------------------------------------------------------------------
vsftp skill
问:如何允许root用户ftp登陆
答:修改/etc/vsftpd下的ftpusers和user_list
ftpusers:
#root
user_list:
root=NO
-----------------------------------------------------------------------------------------------------------
PXE skills
参考资料:
http://www-128.ibm.com/developerworks/cn/linux/l-tip-prompt/l-pex/index.html
http://syslinux.zytor.com/pxe.php#config
必要的配置文件:
/etc/dhcpd.conf(参考dhcp configuration document to run)。
/etc/xinetd.d/tftp(参考tftp skills document to run)。
/tftpboot/pxelinux.cfg/default(参考PXE Linux configuration)。
光盘内容都已经拷贝到10.46.1.170/tftpboot。
确认pxelinux.0 ,vmlinuz(Linux内核)和initrd.img(Linux根文件系统)拷贝到Linux Server的/tftpboot下。
-----------------------------------------------------------------------------------------------------------
PXE Linux configuration
/tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
label linux
  kernel vmlinuz
  append console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label text
  kernel vmlinuz
  append text console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label rescure
  kernel vmlinuz
  append rescure console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label expert
  kernel vmlinuz
  append expert initrd=initrd.img ramdisk_size=8192
label ks
  kernel vmlinuz
  append ks initrd=initrd.img ramdisk_size=8192
label lowres
  kernel vmlinuz
  append initrd=initrd.img lowres ramdisk_size=8192
label local
  localboot 1 console=ttyS0,9600
label memtest86
  kernel memtest
  append -
-----------------------------------------------------------------------------------------------------------
file control
find -name filename
-----------------------------------------------------------------------------------------------------------
system manage
directory capacity: du -k
hda usage: df -k
-----------------------------------------------------------------------------------------------------------
dhcp configuration
vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 10.46.1.160 netmask 255.255.255.224 {
# --- default gateway
        option routers                  10.46.1.1;
        option broadcast-address        10.46.1.255;
        option domain-name              "domain.org";
        option domain-name-servers      10.46.1.170;
        range 10.46.1.184 10.46.1.187;
        default-lease-time 21600;
        max-lease-time 43200;
        group {
                next-server 10.46.1.170;
                filename "pxelinux.0";
                host tftpclient {
                        hardware ethernet 00:03:BA:4C:DF:2A;
                        fixed-address 10.46.1.184;
                }
                host tftpclient1 {
                        hardware ethernet 00:03:BA:4C:DF:2B;
                        fixed-address 10.46.1.184;
                }
                host tftpclient2 {
                        hardware ethernet 00:03:BA:44:3F:8E;
                        fixed-address 10.46.1.186;
                }
                host tftpclient3 {
                        hardware ethernet 00:03:BA:44:3F:8F;
                        fixed-address 10.46.1.186;
                }
                host tftpclient4 {
                        hardware ethernet 00:03:BA:44:3E:BE;
                        fixed-address 10.46.1.184;
                }
                host tftpclient5 {
                        hardware ethernet 00:03:BA:44:3E:BF;
                        fixed-address 10.46.1.184;
                }
                host tftpclient6 {
                        hardware ethernet 00:03:BA:44:3D:A2;
                        fixed-address 10.46.1.185;
                }
                host tftpclient7 {
                        hardware ethernet 00:03:BA:44:4E:40;
                        fixed-address 10.46.1.186;
                }
        }
}
vi /tftpboo/pxelinux.cfg/default
default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
label linux
  kernel vmlinuz
  append console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label text
  kernel vmlinuz
  append text console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label rescure
  kernel vmlinuz
  append rescure console=ttyS0,9600 initrd=initrd.img ramdisk_size=8192
label expert
  kernel vmlinuz
  append expert initrd=initrd.img ramdisk_size=8192
label ks
  kernel vmlinuz
  append ks initrd=initrd.img ramdisk_size=8192
label lowres
  kernel vmlinuz
  append initrd=initrd.img lowres ramdisk_size=8192
label local
  localboot 1 console=ttyS0,9600
label memtest86
  kernel memtest
  append -
开放dhcp server的root登陆ftp权限
/etc/vsftpd/ftpusers
/etc/vsftpd/vsftpd.conf
开放tftpboot目录权限
/etc/init.d/dhcpd eth0 start
-----------------------------------------------------------------------------------------------------------
 linux网络抓包
tcpdump host ip


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:150480次
    • 积分:4028
    • 等级:
    • 排名:第7678名
    • 原创:242篇
    • 转载:0篇
    • 译文:0篇
    • 评论:16条
    文章存档
    最新评论