使用ssh远程进行远程设备管理,比telnet安全多了,因为telnet是明文传输,而ssh 是利用rsa不对称算法进行加密处理的,
在服务器生成公钥和私钥,私钥是唯一的把公钥发给客户,客户使用公钥加密数据,发到服务器,服务器使用私钥进行解密
R2(config)#ip domain-name
配置一个域名,这个必须得配置,不然无法配置ssh
R2(config)#crypto key generate rsa general-keys modulus 1024
生成一对rsa的密钥,密钥为1024位
% You already have RSA keys defined named .
% They will be replaced.
% The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
R2(config)#ip ssh time-out 10
ssh远程登录的超时时间为10秒
R2(config)#ip ssh authentication-retries 2
ssh认证重复次数为两次
R2(config)#line vty 0 15
R2(config-line)#transport input ssh
设置vty的登录为ssh,默认的all允许所有登录
R2(config-line)#exit
R2(config)#aaa new-model 开启aaa服务
R2(config)#aaa authentication login default local 使用本地数据库
R2(config)#username cisco password cisco
远程管理时的用户名和密码
客户机上就可使用ssh远程管理设备了
R1#ssh -l cisco 192.168.0.1
Password:
R2>en
Password:。