配置主机名与域名
1、进入特权模式
ESW1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
2、配置主机名
ESW1(config)#hostname oleilei
oleilei(config)#
3、配置域名
oleilei(config)#ip domain-name ?
WORD Default domain name
vrf Specify VRF
oleilei(config)#ip domain-name oleilei.com
了解什么是 line
1、”line“ 命令有多个选项参数
oleilei(config)#line ?
<0-198> First Line number
aux Auxiliary line
console Primary terminal line
tty Terminal controller (终端控制器)
vty Virtual terminal (虚拟控制器)
x/y Slot/Port for Modems
2、”who“ 查看当前自己所在位置
oleilei(config)#do who
Line User Host(s) Idle Location
* 0 con 0 idle 00:00:00
配置 line 选项卡
1、建立 ssh 用户
oleilei(config)#aaa new-model
The aaa new-model command causes the local username and password on the router
oleilei(config)#username cisco password 0 cisco
2、配置 ssh
oleilei(config)#crypto key generate rsa
oleilei(config)#ip ssh version 2
oleilei(config)#do show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 5
3、配置一些信息
oleilei(config-line)#exit
oleilei(config)#ip ssh ?
authentication-retries Specify number of authentication retries ( 指明 authentication 尝试次数 )
break-string break-string
logging Configure logging for SSH
maxstartups Maximum concurrent sessions allowed
port Starting (or only) Port number to listen on
rsa Configure RSA keypair name for SSH
source-interface Specify interface for source address in SSH
connections
time-out Specify SSH time-out interval ( 指明 SSH 超时间隔 )
version Specify protocol version to be supported ( sshv2 Or sshv1 )
4、配置 vty 传输模式
oleilei(config)#line vty 0
VTY是路由器的远程登陆的虚拟端口,0 4表示可以同时打开5个会话。
oleilei(config-line)#transport input ssh
5、配置用户上线后特权模式密码
oleilei(config)#enable secret 0 password
oleilei(config)#enable password 0 password
客户端登陆
ssh -v 2 -l oleilei 192.168.1.1