注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 可扩展、高可用、负载均衡..
 帮助

去除交换机密码


2008-03-28 22:57:17
 标签:交换机 密码   [推送到技术圈]

使用超级终端通过CONSOLE口登陆到交换机。
 
方法一:
1、将交换机断电后,重新接电,按住交换机的MODE键,进入ROM模式。
C2900XL Boot Loader (C2900-HBOOT-M) Version 12.0(5.2)XU, MAINTENANCE INTERIM SOF
TWARE
Compiled Mon 17-Jul-00 18:19 by ayounes
 starting...
Base ethernet MAC Address: 00:04:9a:af:0b:c0
Xmodem file system is available.
The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating
system software:
    flash_init
    load_helper
    boot
switch:
 
2、输入flash_init     //初始化交换机
switch: flash_init
Initializing Flash...
flashfs[0]: 107 files, 3 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 3612672
flashfs[0]: Bytes used: 2143744
flashfs[0]: Bytes available: 1468928
flashfs[0]: flashfs fsck took 6 seconds.
...done Initializing Flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
 
3、输入load_helper  //导入帮助文件,这条命令为可选项
 
4、输入dir flash:  //查看flash中的内容
switch: dir flash:
Directory of flash:/
2    -rwx  1119096   <date>               c2900XL-hs-mz-112.8.10-SA6.bin
4    drwx  6784      <date>               html
111  ---x  932       <date>               config.text
112  -rwx  286       <date>               env_vars
2143744 bytes available (1468928 bytes used)
密码保存在config.txet中,只要删除config.txet文件就可以去除密码。
 
5、输入:delete flash:config.text         //删除配置文件
switch: delete flash:config.text
Are you sure you want to delete "flash:config.text" (y/n)?y
File "flash:config.text" deleted
 
6、输入boot,重启系统
switch: boot
Loading "flash:c2900XL-hs-mz-112.8.10-SA6.bin"...###############################
#######################################################################
File "flash:c2900XL-hs-mz-112.8.10-SA6.bin" uncompressed and installed, entry po
int: 0x3000
executing...
 
这种方法比较简单,但是存在缺陷,原有的配置和密码一起全部被删除了。如何既去除密码又保存原有配置呢?
方法二可以达到这个目的。
 
方法二:
前三个步骤和方法一相同。
1、2、3步省略
4、switch: rename flash:config.text flash:config.old   //对配置文件进行重命名,随便一个都可以
 
5、输入boot,重启系统
 
6、提示Continue with configuration dialog? [yes/no]:   //因为flash中配置文件名字被修改,系统
无法找到配置文件,因此初始化配置文件
输入n
Press RETURN to get started.
 
7、进入特权模式,输入rename flash:config.old flash:config.text  //将配置文件名字改回来
Switch#rename flash:config.old flash:config.text
Source filename [config.old]?
Destination filename [config.text]?
 
8、将配置文件从flash中复制到ram中,即还原以前配。
Switch#copy flash:config.text system:running-config
Source filename [config.text]?
Destination filename [running-config]?
932 bytes copied in 0.980 secs
 
9、进入全局模式,重新配置密码即可。
Switch#configure terminal
Switch(config)#Switch(config)#enable password XXX
 
10、回到特权模式,保存即可。
Switch#write
Building configuration...
[OK]
 
 
完成以上步骤之后,我们既修改了密码,又保存原有的其他配置,达到去除密码的目的。
 
PS:
网上有些资料说交换机必须在超级终端连接后才能加电启动,如果先开交换机再用超级终端连接的话则无法进入监控模式。今天由于时间关系没有来得及验证。




    文章评论
 
2008-03-30 12:29:28
恩 以后我去验证看看

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: