cisco设备配置SSH

配置主机名与域名

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
  • 4
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值