一,MBR故障排除:
1,準備另外一塊磁盤或分區
2,備份mbr扇區
[root@localhost~]# dd if=/dev/sda of=/date/sda.mbr bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.010756 seconds, 47.6 kB/s
[root@localhost~]# ls /date/sda.mbr
/date/sda.mbr
3,模擬mbr扇區故障並重啓
[root@localhost~]# dd if=/dev/zero of=/dev/sda bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512B) copied, 1.3e-05 seconds, 39.4 MB/s
[root@localhost~]# reboot
4,啓動故障
5,放入光盤bios設置cdrom啓動,開機進入救援模式
6,恢復備份的mbr文件
7,mbr修復完畢
拓展:mbr的修復方法(1)本機備份恢復(2)其他同時上線的服務器中拷mbr備份
二,grub.conf文件出錯或丟失:
1,開機提示grub>
進行以下操作:
grub>root (hd0,0)
grub>kernel /vmlinuz-2.6.18-348.e15ro root=/dev/sda2
grub>initrd/initrd-2.6.18-348.e15.img
grub>boot
2,進入系統添加編輯grub.conf
# vim /boot/grub/grub.conf
timeout=5
default=0
title NSD1312 Linux Server
root(hd0,0)
kernel/vmlinuz-2.6.18-348.el5 ro [root=/dev/sda2]
initrd/initrd-2.6.18-348.el5.img
擴展:grub故障恢復(1)從備份(2)自己編輯設置grub.conf文件
三,inittab文件丟失:
1,刪除inittab文件,查看inittab文件的安裝包,重啓系統
[root@localhost ~]# rm -f /etc/inittab
[root@localhost ~]# rpm -qf /etc/inittab
initscripts-8.45.42-1.el5_8.1
2,放光盤進入救援模式重新強制安裝inittab安裝包
四,開機破解密碼:
1,開機上下鍵調節進入內核模式
2,e進入查看模式
3,e進入編輯模式
4,改完Enter,b重啓進入單用戶模式
rhel5與rhel6設置密碼有所差別
五,遠程控制實驗:
1,服務端設置:
# vim /etc/ssh/sshd_config
2,查看並重啓ssh服務
[root@localhost ~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
3,Windows客戶端驗證:
登錄成功
4,從另外一臺Linux主機遠程控制|服務端
[root@localhost ~]# ssh -p 8821 [email protected]
[email protected]'s password:
Last login: Wed Feb 26 18:45:59 2014 from192.168.194.1
[root@localhost ~]# ifconfig eth0
eth0 Linkencap:Ethernet HWaddr00:0C:29:47:5B:62
inetaddr:192.168.194.137 Bcast:192.168.194.255 Mask:255.255.255.0
inet6addr: fe80::20c:29ff:fe47:5b62/64 Scope:Link
UPBROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RXpackets:260 errors:0 dropped:0 overruns:0 frame:0
TXpackets:195 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RXbytes:28705 (28.0 KiB) TX bytes:29338(28.6 KiB)
5,把本地文件上傳至服務端
[root@localhost ~]# exit
logout
Connection to 192.168.194.137 closed.
[root@localhost ~]# scp -P8821 install.log[email protected]:/root/Desktop/test.file
[email protected]'s password:
install.log 100% 31KB 31.3KB/s 00:00
6,從服務端下載文件
[root@localhost ~]# scp -P8821[email protected]:/root/Desktop/test.file/root/Desktop/
[email protected]'s password:
test.file 100% 31KB 31.3KB/s 00:00
7,利用ftp訪問服務端
[root@localhost ~]# sftp-oPort=8821[email protected]
Connecting to 192.168.194.137...
[email protected]'s password:
sftp> cd /
sftp> ls
bin boot dev etc home lib
lib64 lost+found media misc mnt net
opt proc root sbin selinux srv
sys tftpboot tmp usr var