传统的telnet方式不安全,很容易被别人抓包软件抓到.使用ssh登入cisco设备,比telnet安全多
了.下面是配置步骤.
① 配置hostname和ip domain-name
Router#configure terminal
Router(config)#hostname test
test(config)#ip domain-name jx.cn.net -------配置SSH必需
test(config)#username test password 0 test
test(config)#username test password 0 test
注:添加一个用户:test,口令:test
test(config)#line vty 0 4
test(config-line)#login local
test(config-line)#transport input ssh -----只允许用SSH登录(注意:禁止telnet和从
交换引擎session!)
③ 配置SSH服务:
test(config)#crypto key generate rsax+v
The name for the keys will be: TEST-GSR12008.jx.cn.net
注:SSH的关键字名就是hostname + . +ip domain-name
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minuts
How many bits in the modulus [512]: 注:选择加密位数,用默认就行了
Generating RSA keys ...
[OK]
用命令show ip ssh也能看到:
SSH Enabled - version 1.5
Authentication timeout: 120 secs; Authentication retries:
现在SSH服务已经启动,如果需要停止SSH服务,用以下命令:
TEST-GSR12008(config)#crypto key zeroize rsa
④设置SSH参数
配置好了SSH之后,通过show run命令我们看到SSH默认的参数:超时限定为120秒,认证重试次数为3次,可以通过下面命令进行修改:
test(config)#ip ssh {[time-out seconds]} │ [authentication-retries interger]}
如果要把超时限定改为180秒,则应该用:
test(config)# ip ssh time-out 180
如果要把重试次数改成5次,则应该用:
test(config)# ip ssh authentication-retries
这样,SSH已经在路由器上配置成功了,就能够通过SSH进行安全登录了。
0
收藏
推荐专栏更多
猜你喜欢
我的友情链接
FWSM配置注意点以及心得
Linux基础:利用SSH上传、下载(使用sz与rz命令)
linux中ssh/scp连接远程ssh非22端口的服务器方法
使用ssh-keygen设置ssh无密码登录
CenOS6.3 ssh 公钥认证报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).解决
linux下怎么查看ssh的用户登录日志
jenkins使用Publish Over SSH插件实现远程自动部署
ssh连接报错:Connection refused的解决办法
Linux centos 远程SSH默认22端口修改为其他端口
linux ssh_config和sshd_config配置文件
SSH 登录失败:Host key verification failed 的处理方法
IPv6通讯原理(1) - 不能忽略的网卡启动过程
华为MSTP、VRRP与DHCP综合项目详解
PBR下一跳类型研究
VRRP实训案例配置
OSPF基本概念以及DR/BDR和虚连接OSPF特殊区域的实验操作
简单搭建OSPF,RIP,NSSA,外部路由汇总网络拓扑
OSPF路由重分发
OSPF协议的“地址汇总配置”及“虚链路配置”
扫一扫,领取大礼包
转载于:https://blog.51cto.com/swver/67109
Ctrl+Enter 发布
发布
取消