• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • troubleshooting經驗總結

    發表于:2007-07-04來源:作者:點擊數: 標簽:
    10、pam 11、拒絕ssh登錄(用戶) a./etc/ssh/sshd_config denyusers user b.pam 中/etc/security/access.conf /etc/pam.d/sshd ¥¥¥¥¥¥¥¥¥¥¥¥ 一、MBR錯誤。 ¥¥¥¥¥¥¥¥¥¥¥¥¥ 二 grub.conf 三、/etc/inittab ¥¥¥¥¥¥¥¥¥¥¥

    10、pam
    11、拒絕ssh登錄(用戶)
    a./etc/ssh/sshd_config
    denyusers user
    b.pam 中/etc/security/aclearcase/" target="_blank" >ccess.conf
    /etc/pam.d/sshd


    ¥¥¥¥¥¥¥¥¥¥¥¥
      一、MBR錯誤。  

    ¥¥¥¥¥¥¥¥¥¥¥¥¥
    二  grub.conf

     三、/etc/inittab

    ¥¥¥¥¥¥¥¥¥¥¥¥¥
    四、
    mount /sbin/init /bin/bash   文件丟失或被替換

    ¥¥¥¥¥¥¥¥¥¥¥¥¥
    五。xwindow錯誤
    一般來說與/etc/X11/XF86config文件有關,考試中不可能涉及硬盤問題。
    運行redhat-config-xfree86一般都能解決,可能發生的問題較多,普通點的就是刷新率,顯
    示模式如800x600等。

    還有
    空間滿和配置文件無??!

    X字體服務(xfs)是否運行

    ¥¥¥¥¥¥¥¥¥¥¥¥¥
    六、
    root不能正常登錄


    ********密碼

    (一)出現Login incorrect 多半與密碼相關
    1、的確是密碼錯誤 單用戶模式修改
    2、root用戶被鎖  單用戶模式 usermod -U root 即可
    3、沒有root用戶,即沒有uid為0的用戶
    4、/etc/securetty文件中沒有tty*(*表示1,2,3,4等)
    5。密碼過期和鎖定
    常用的兩種讓 帳戶無法登陸的方法

    a.
    shadow文件的 密碼這一位  前面加??!   表示帳戶被鎖 登陸時的提示是 密碼error,logs里提示是 認證失敗
    root:!!njamFCM$y6axVvkvvw7eS04bfOprz/:12908:0:99999:7:::
    解決方法:把??!去掉

    b.
    shadow 文件的最后一位 也就是  從1970。1。1號開始 多少天帳號失效 這一位 加具體時間
     root:njamFCM$y6axVvkvvw7eS04bfOprz/:12908:0:99999:7::1:
    如上,表示 1970。1。1后 1 天失效

    解決方法: 把1 去掉


    d./etc/securitty 定義了
    root可安全登錄的終端
    e.沒用root用戶,uid=0 用戶不存在

    2、user不可登錄
    同上a. b . c.
    d .存在/etc/nologin空文件
    e.passwd文件中沒有shell或被替換
    f. /etc/bash_profile
    g. .bash_profile 中有exit,logout
    3、root user都不可登錄, /bin/bash被替換或刪除
    4、檢查pam, /etc/security/access.conf , /etc/pam.d/system-auth,
    用authconfig清除設置


    無法修改密碼,報unable to lock password file. 錯誤

    linux修改不了密碼(包括root帳號),也不能建立新帳號,提示unable to lock password file. 修改passwd, shadow的屬性結果還是一樣

      答:出現該信息,說明上次更改密碼的程序(passwd)沒有正常退出, 或者現在有另外一個程序正在使用/etc/passwd文件??梢缘?etc下查看相關的*lock*文件, 以及passwd文件的屬性,將相關的lock文件刪除,然后再修改密碼即可。

      


    PAM相關*******
    (二)輸入用戶名和密碼后,只見屏幕一閃,,那多半與authconfig、pam有關了
    1、三輪車夫同志遇到的。authconfig時,選了ldap認證,后來ldap服務器的地址變了后,
    就無法登錄。
       解決辦法:運行 authconfig取消該選項。
    2、/etc/pam.d/system-auth中添加了
       account required /lib/security/$ISA/pam_access.so
       或其他類似的pam模式限制,如pam_listfile.so、pam_time.so等。
      解決辦法同上,運行authconfig后會自動刪掉。
    3、/etc/pam.d/login中添加了
       account required /lib/security/$ISA/pam_access.so
       或其他類似的pam模式限制,如pam_listfile.so、pam_time.so等。
      解決辦法:只有手工去查看login文件,運行authconfig后不會自動取消。
    4、/etc/pam.d/  目錄中的system-auth 或login中的模塊文件名有誤。
      模塊文件名錯誤同樣會使系統無法登錄。
      建議發生無法登錄的情況時,到單用戶或rescue模式,首先查看/var/log/secure 和
    message文件。


    ¥¥¥¥¥¥¥¥¥¥¥¥¥
    七、
    服務的控制:

    (一)網絡配置錯誤
          ip addr netmask route gateway 大不了加上tc iptables ipchains 以及相關的配置文件
    (二)DNS解析錯誤
          大多在/etc/host.conf /etc/resolve.conf  /etc/hosts這些文件有關
    (三)xwindow的桌面環境及主要的一次配置文件.xinitrc、XF86Config、/etc/X11/Xxxx目
    錄下面的
    (四)磁盤分區,文件系統,swap分區相關
        (五)診斷和修復其他daemon錯誤(就是各種網絡服務啦),

    1、HTTP/HTTPS
       httpd -t 測試配置文件
    2、SMB
       testparm 測試配置文件
    3、NFS
       showmount -e localhost 看自己是否正常提供了exports
       rcpinfo -p localhost   看portmap 是否正常
    4、FTP
       AS3目前自帶vsftpd,配置非常簡單
    5、Web proxy
       AS3目前自帶squid,如果只是要配置一個簡單的帶認證的web proxy,根據conf文件
    修改非常簡單
    6、SMTP
       默認sendmail、也可使用postfix(網易就是用的這個)
    7、IMAP, IMAPS, and POP3
       要簡單使用,幾乎不用配置。
    8、SSH
       /etc/ssh/sshd_config,幾乎每天都要用的東西
    9、DNS
       named-checkconf   named-checkzone檢查配置文件

       確實找不到問題所在,rpm -ivh --force software.2.x.x.x.rpm

    八、一道限制telnet 訪問的題目

    方法有:

    add the following line to the /etc/xinetd.d/telnet configuration file:
    no_access = 127.0.0.1


    /etc/hosts.deny file in a text editor. Add the following line:
    in.telnetd : ALL


    /sbin/iptables -A INPUT -s 127.0.0.1 -p tcp --dport 23 -j DROP


    九:關于啟動過程中出錯的補充

    (一)、mbr損壞或丟失. 進入RESCUE模式,grub-install
    linux rescure
    grub-install /dev/hda?

    (二)、啟動時所需的配置文件不正確
    (要對文件的內容與格式熟悉)看看"大壞羊"的貼子
    Kernel panic : no init found,Try passing init = option to kernel

    /boot/grub/grub.conf *************************************************
     grub.conf
    grub.conf丟失(只能用rescue模式)


    如果出錯

    grub的一般情況
    root(hdx,x)錯誤和 根分區(/分區)即root=/dev/xxx不對
    記root(hdx,x) 是內核保存位置即 /boot分區的磁盤。這里寫法要注意
    root=/dev/xxx 是/分區位置

    1、如果沒有找到內核(vmlinuz-x.x.x文件),
      出現File not found
        Press any key to continue....
      說明root(hdx,x)錯誤,或內核文件名不對
    2、如果找到內核后,運行一會,
      出現kernel Panic:Not init Found,
      一般來說是沒有找到根分區(/分區)即root=/dev/xxx不對
    3、如果找到內核后,運行一會,
      出現Kernel panic: VFS: Unable to mount root fs on ...,
      一般來說可能忘了加上initrd /initrd-2.4.21-4.EL.img(大多情況發生在使用scsi硬盤)
    4、總的來說grub.conf里面必須存在的就幾行。
    #more grub.conf
    title linux
    root (hd0,1)                                        #/boot分區所在位置
    kernel /vmlinuz-2.4.21-4.EL ro root=/dev/TEST/root #內核和根分區(/分區)位置
    (根分區可能是LVM和raid,而不僅是hdx和sdx)
    initrd /initrd-2.4.21-4.EL.img


     方法:
    root (hd0,1)
    ro root=/dev/TEST/root 要會寫

    如果丟失 需要用rescue模式寫這個文件,至少需要title  root   kernel initrd四句
    **************************************************


    /etc/inittab
    **************************************************
    方法:如果不大明白//etc/inittab的格式,強制重裝initscripts的rpm包即可

    一般來說就是inittab文件丟失或者有錯誤。

    方法:如果丟失那就到rescue模式下重新安裝,包名initscripts(如果遇到系統有inittab文件要你恢復出來


     如果出錯,可以到單用戶模式下,修改


    注意:
    如果不是在rescue模式,修改fstab和inittab文件時出來Read-only file system咋辦?重新裝載成讀
    寫模式
    mount -o remount,rw /dev/sdax /
    *******************************************************

    /etc/fstab  
    可以不需要其他方法 ,當出現repaire filesystem時候,輸入密碼,mount -o remount defaults,rw /
    *******************************************************
    1。啟動rescure模式
    2。用fdisk -l看磁盤情況。用e2label /dev/hda?看具體卷標
    3。mkdir /mnt/sysimage
    4。把所有分區都mount到該目錄下。用man fstab看具體寫法
    5。在/etc下創建 fstab文件。
    重新啟動。

    *******************************************************


    (三)、啟動系統時,所用的文件或目錄丟失
    如:mount ,bash,inittab,init ,/initrd ,/proc

    1.mount,bash被替換或刪除。 進入RESCUE模式,網絡重新安裝mount,bash包

    mount /sbin/init /bin/bash   文件丟失或被替換

    如:

    在系統啟動的時候,提示分區無法加載!
    經檢查,發現/etc/fstab的信息是正確的!
    分析,可能是/bin/mount 命令被替換!
    問,現在如何進行系統的修復!


    進入linux rescue 模式:
    rpm -Vf --root /mnt/sysimage /bin/mount
    你會發現有問題!
    rpm -qf --root /mnt/sysimage /bin/mount
    查找該文件屬于哪個RPM安裝包
    rpm -ivh --force --root /mnt/sysimage /mnt/source/Redhat/RPMS/packagename.rpm
    sync
    sync
    sync
    exit


    2./sbin/init 丟失或替換。此文件在SysVinit*包內,此包還包括如下文件:/sbin
    halt,poweroff,init,runlevel,reboot,shutdown等
    init丟失時,(a)、直接啟動時會進入bash2.05#只讀shell
    (b)、用單用戶進入如下提示:
    s :s no such file or directory
    kernel panic : Attempted to kill init
           修復如mount的修復

    3.initscripts*包

    啟動的相關文件:/etc/inittab,/etc/rc.d,/etc/rc.d/rc,rc.sysinit,
    /etc/sysconfig/* ,/etc/sysclt.conf, /sbin/ifup,/sbin/ifdown
    /sbin/service
    # inittab丟失: INIT:no inittab file found.
    Enter runlevel:
    #/etc/rc.d ,/etc/rc.d/rc 丟失:
    用reboot,shutdown,init 6 命令重啟時有如下明顯提示:
    INIT : can not execute "/etc/rc.d/rc"
    INIT: no more processes left in this runlevel
    按電源重啟系統,可以到達login界面:
    Kernel 2.4.21-15.EL on an i686
    ( none ) login :
    可以登錄,但會提示:
    modprobe : modprobe : Can't locate module Char-major-10-224
    login(PAM-unix)[22] Session ipened for user root by (uid=0)
    -bash: Command not found
    此時沒有網絡,不能修復,主要提示在重啟的時候,進入rescue模式,
    修復后可正常使用,/etc/rc.d丟失,重新安裝initscripts*包,登錄時
    仍會有提示,但常使用。
    #/etc/rc/rc.sysinit 為系統啟動時所用的第一個腳本,若丟失
    系統啟動時:
    INIT : can't execute /etc/rc.d/tc.sysinit not found
    及其它提示
    #/sbin/ifup,/sbin/ifdown 如果丟失,網絡將無法啟動。
    #/sbin/service 若丟失或被替換,任何服務無法啟動。
            需要rescue修復。

    4. /initrd 目錄丟失,啟動時有如下提示:
    pivotroot: pivotroot (/sysroot,/sysroot/initrd) failed: 2
    umount /initrd/proc failed : 2
    Freeing unused kernel memory : 164k freed
    Kernel panic : no init found,Try passing init = option to kernel
    進入rescue模式,建立/initrd 目錄即可    需要rescue修復。

    (6)Debug Exercise IV
    In this exercise, you'll be practicing with Telnet. The service can be on or off by default. It may be blocked by a firewall. Service may be denied through the /etc/xinetd.d/telnet configuration file or through /etc/hosts.deny. Ideally, you'll be able to check your work through another computer on a LAN.

    1.Start Red Hat Linux. Check for the installation of the telnet package with the rpm -q telnet command. Install the telnet RPM if required.
    2.Check your configuration for a firewall with the /sbin/service iptables status command.
    3.If there are iptables rules active on your system, you may want to back them up with the /sbin/iptables-save > filename command.
    4.If you have iptables rules, flush them with the /sbin/iptables -F command.
    5.Check your /etc/hosts.allow and /etc/hosts.deny files. If there are rules related to in.telnetd or ALL services in either file, comment them out.
    6.Check the default status of Telnet with the /sbin/chkconfig --list telnet command. The response should be off or on. Use chkconfig to turn Telnet on if required.
    7.Check the /etc/xinetd.d/telnet configuration file. If there are only_from or no_access directives in this file, comment them out.
    8.Now you should be able to connect to Telnet. Try it from the local computer with the telnet localhost command. You should be able to log in with a local user name and password. Log out of Telnet.
    9.Repeat the telnet access request from a remote computer. Use the name or the IP address of the Telnet server. Log out of Telnet.
    10.On the Telnet server, add the following line to the /etc/xinetd.d/telnet configuration file:
    no_access = 127.0.0.1
    11.From the computer with the Telnet server, try the telnet localhost command. What happens? Is a successful login through Telnet unexpected?
    12.Run the /sbin/service xinetd reload command. Repeat step 11. What happens now? If possible, try to use the telnet command to connect to the Telnet server from a different computer on your LAN. Can you connect?
    13.Restore the original /etc/xinetd.d/telnet configuration file and run /sbin/service xinetd reload command again.
    14.Open the /etc/hosts.deny file in a text editor. Add the following line:
    in.telnetd : ALL
    15.Repeat step 11. What happens now? Try this again from another computer on your LAN.
    16.Restore the original /etc/hosts.deny file.
    17.Now try to set up a firewall to block yourself from accessing Telnet on the local computer.
    18.Add the following iptables chain to your firewall (the TCP/IP port for Telnet is 23. You can look up the port you need in /etc/services):
    /sbin/iptables -A INPUT -s 127.0.0.1 -p tcp --dport 23 -j DROP
    19.Verify that your computer accepted this new rule with the iptables -L command. You should see that packets destined for Telnet are to be dropped.
    20.Repeat step 11. What happens now? Try to log in via Telnet again from another computer on your LAN.
    21.Note how the response is different when you block access through a firewall and through a file such as /etc/hosts.deny.
    22.Restore your original firewall. Flush the rule that you created with the /sbin/iptables -F command. Then restore the old rules if required with the /sbin/iptables-restore < filename command.

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>