HCNA-4 配置通过STelnet登录系统
HCNA-4 配置通过STelnet登录系统1、基本配置R1<Huawei>system-viewsysname R1interfaceGigabitEthernet 0/0/0ipaddress 10.1.1.100 24return<R1>saveR2<Huawei>clocktimezone BJ add 8:00:00<Huawei>clockdatetime 22:25 2020-04-14<Huawei>system-viewsysname R2header logininformation "ipgzj.com"//配置登录时标题文本显示header shellinformation "zurkj.com" //配置登录成功后标题文本显示interfaceGigabitEthernet 0/0/0ipaddress 10.1.1.1 24return<R2>saveR1<R1>ping10.1.1.1PING 10.1.1.1: 56data bytes, press CTRL_C to break Reply from 10.1.1.1: bytes=56 Sequence=1ttl=255 time=440 ms Reply from 10.1.1.1: bytes=56 Sequence=2ttl=255 time=20 ms Reply from 10.1.1.1: bytes=56 Sequence=3ttl=255 time=20 ms Reply from 10.1.1.1: bytes=56 Sequence=4ttl=255 time=20 ms Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255time=40 ms
--- 10.1.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 20/108/440 ms
2、配置SSH Serverrsalocal-key-pair create //生成本地RSA主机密钥对The key name willbe: Host% RSA keys definedfor Host already exist.Confirm to replacethem? (y/n):y //确认The range ofpublic key size is (512 ~ 2048).NOTES: If the keymodulus is greater than 512, It will take a few minutes.Input the bits inthe modulus:Generating keys...............++++++++++++...........++++++++++++.................++++++++.....++++++++display rsalocal-key-pair public //查看本地密钥对中的公钥部分信息
=====================================================Time of Key pair created: 2020-04-14 22:34:12+08:00//描述公钥生成的时间Key name: Host //描述公钥名称Key type: RSA encryption Key//描述公钥类型=====================================================Key code:30470240 C0D7F0F5 0B7BF723 281F41F8 830C304747FF6508 EF2521B6 CD885E4D B07DEE2D FE72212977FA2BCA 6A6104F5 03727704 94E300F3 0E6763A955AC4257 2CCBBB53 0203 010001
=====================================================Time of Key paircreated: 2020-04-14 22:34:14+08:00Key name: ServerKey type: RSAencryption Key=====================================================Key code:30670260 C568360D 59CD85B8 50A59597 2EEA9D5E34F41F68 CE505383 27E9EEE0 DDF31A1C E7A69FF3146C7A54 77A07D38 4DEB81ED F22AAA85 577BBD20E4E0AEBB F203AEF5 60230524 C1144F3B 20DEE28665A9C20A 1AB0001F F20DE4BA 2D214C05 9DC5FA7B 0203010001user-interfacevty 0 4//配置VTY 用户界面authentication-modeaaa //配置认证模式AAAprotocolinbound ssh //指定VTY类型用户界面只支持SSH协议,设备会禁止Telnet功能aaa local-userzurkj password cipher admin1234 //配置本地用户 密码local-userzurkj privilege level 15 //配置本地用户权限级别local-userzurkj service-type ssh //配置本地用户接入类型为SSHquitssh user zurkjauthentication-type password //新建SSH用户 指定SSH用户认证模式为密码stelnet serverenable //开启STelnet服务display sshuser-information zurkj //查看SSH用户信息 -------------------------------------------------------------------------------
Username Auth-type User-public-key-name ------------------------------------------------------------------------------- zurkj password null -------------------------------------------------------------------------------display sshserver status //查看SSH服务器全局配置信息 SSH version :1.99 SSH connection timeout :60 seconds SSH server key generating interval:0 hours SSH Authentication retries :3 times SFTP Server : Disable Stelnet server :Enablequit<R2>save
3、配置SSHClient<R1>system-viewssh clientfirst-time enable //配置SSH用户端首次认证功能stelnet10.1.1.1 //STelnet远程访问Please input theusername:zurkjTrying 10.1.1.1...Press CTRL+K toabortConnected to10.1.1.1 ...The server is notauthenticated. Continue to access it? (y/n):yApr 14 202022:54:32-08:00 R1 %%01SSH/4/CONTINUE_KEYEXCHANGE(l):The server had not beenauthenticated in the process of exchanging keys. When deciding whether to continue, theuser chose Y. Save the server'spublic key? (y/n):yThe server'spublic key will be saved with the name 10.1.1.1. Please wait...
Apr 14 202022:54:35-08:00 R1 %%01SSH/4/SAVE_PUBLICKEY(l):When deciding whether to save theserver's public key 10.1.1.1, the user chose Y. ipgzj.com
Enter password:zurkj.com<R2><R2>displayssh server session //查看SSH会话连接 -------------------------------------------------------------------- ConnVer Encry State Auth-type Username -------------------------------------------------------------------- VTY 0 2.0 AES run password zurkj
--------------------------------------------------------------------
4、配置SFTPServer和Client<R2>system-viewlocal-useripgzj password cipher admin1234 privilege level 15 //本地用户 密码 权限级别local-useripgzj service-type ssh //本地用户服务类型 SSHlocal-useripgzj ftp-directory flash: //配置用户的可访问目录quitsshuser ipgzj authentication-type password//新建SSH用户 指定SSH用户认证模式为密码sftpserver enable //开启SFTP服务displayssh server status //查看SSH服务器全局信息 SSH version :1.99 SSH connection timeout :60 seconds SSH server key generating interval:0 hours SSH Authentication retries :3 times SFTP Server :Enable Stelnet server :Enablereturn<R2>save<R1>system-viewstelnet10.1.1.1//远程连接STelnetPleaseinput the username:ipgzj //输入用户名Trying10.1.1.1 ...PressCTRL+K to abortConnectedto 10.1.1.1 ...ipgzj.com
Enterpassword: //输入密码zurkj.com<R2>displayssh server session //查看SSH会话连接信息 -------------------------------------------------------------------- ConnVer Encry State Auth-type Username -------------------------------------------------------------------- VTY 0 2.0 AES run password ipgzj
--------------------------------------------------------------------<R2>
页:
[1]