4 月 092015
 
Switch(config)#line ?
 <0-16> First Line number
 console Primary terminal line
 vty Virtual terminal

Switch(config)#line console ?
 <0-0> First Line number

Switch(config)#line vty ? 
 <0-15> First Line number

Switch(config)#

配置console控制台密码

Switch(config)#line console 0
Switch(config-line)#password hellocisco
Switch(config-line)#exec-timeout ?
 <0-35791> Timeout in minutes

Switch(config-line)#exec-timeout 0 ?
 <0-2147483> Timeout in seconds
 <cr>

Switch(config-line)#exec-timeout 0 0
Switch(config-line)#exit
Switch(config)#exit
Switch#wri

查看show run配置

! 
line con 0
 exec-timeout 0 0
 password hellocisco
line vty 0 4
 login
line vty 5 15
 login
!

配置telnet密码

Switch(config)#line vty 0 ?
 <1-15> Last Line number
 <cr>

Switch(config)#line vty 0 4
Switch(config-line)#password hellocisco
Switch(config-line)#exec-timeout 0 ?
 <0-2147483> Timeout in seconds
 <cr>

Switch(config-line)#exec-timeout 0 0
Switch(config-line)#login 
Switch(config-line)#exit
Switch(config)#exit
Switch#wri

查看telnet相关show run配置

! 
line con 0
 exec-timeout 0 0
 password hellocisco
line vty 0 4
 exec-timeout 0 0
 password hellocisco
 login
line vty 5 15
 login
!

配置SSH登录密码

对配置密码加密

默认仅enable加密密码为加密显示,对enable密码和用户模式密码(console/AUX/telnet/ssh)加密需手工指定

启用加密前

!
enable secret 5 $1$p3Nf$H1f9qXJ4OjS4p6fu447Dd/
enable password hellocisco
!
!
!
! 
line con 0
 exec-timeout 0 0
 password hellocisco
line vty 0 4
 exec-timeout 0 0
 password hellocisco
 login
line vty 5 15
 login
!

启用加密后

Switch(config)#service password-encryption 
Switch(config)#exit
Switch#wri
!
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
!
enable secret 5 $1$p3Nf$H1f9qXJ4OjS4p6fu447Dd/
enable password 7 011B030857040506324F41
!
!
!
!
line con 0
 exec-timeout 0 0
 password 7 141F1707000B2922372B3C
line vty 0 4
 exec-timeout 0 0
 password 7 141F1707000B2922372B3C
 login
line vty 5 15
 login
!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)