Cisco、華爲路由器SSH遠程登陸配置

Cisco路由器配置

Cisco、華爲路由器SSH遠程登陸配置

R1(config)#hostname R1 //設置主機名
R1(config)#int e0/0
R1(config-if)#ip add 202.100.1.1 255.255.255.0 //設置接口地址
R1(config-if)#no shutdown
R1(config)#username wang password qytang //設置用戶名和密碼
R1(config)#ip domain name qytang.com //必須設置路由器域名 不然沒法生效key
R1(config)#crypto key generate rsa // 手動生產ras的key推薦768
How many bits in the modulus [512]: 768
R1(config)#ip ssh version 2 //啓用shh版本2
R1(config)#line vty 0 4
R1(config-line)#login local //採用本地認證
R1(config-line)#transport input ssh //容許ssh協議方式登陸dom

Internet(config)#int e0/0
Internet(config-if)#ip address 202.100.1.2 255.255.255.0
Internet(config-if)#no shutdown
Internet#ssh -l wang 202.100.1.1 //ssh遠程登陸
Password: ssh

R1> //驗證成功ide

華爲路由器SSH配置

Cisco、華爲路由器SSH遠程登陸配置
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 202.100.1.1 24 //配置接口IP地址
[R1-aaa]local-user wang password cipher sinoway //建立用戶和密碼
Info: Add a new user.
[R1-aaa]local-user wang privilege level 15 //設置用戶級別爲最高15級
[R1-aaa]local-user wang service-type ssh //設置容許該用戶容許的服務ssh
[R1]rsa local-key-pair create //建立ras推薦768位
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]:768ui

[R1]user-interface vty 0 4 //進入vty通道
[R1-ui-vty0-4]protocol inbound ssh //vty容許SSH登陸
[R1-ui-vty0-4]authentication-mode aaa //通道認證模式使用aaa模式
[R1]stelnet server enable //開啓ssh服務server

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add
[R2-GigabitEthernet0/0/0]ip address 202.100.1.2 24blog

[R2]ssh client first-time enable //開啓客戶端ssh接口

[R2]stelnet 202.100.1.1 //遠程ssh
Please input the username:wang //輸入用戶名
Trying 202.100.1.1 ...
Press CTRL+K to abort
Connected to 202.100.1.1 ...
The server is not authenticated. Continue to access it? (y/n)[n]:y
Oct 24 2019 10:56:56-08:00 R2 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[0]:The server had not been authenticated in the process of exchanging keys. When deciding whether to continue, the user chose Y.
[R2]
Save the server's public key? (y/n)[n]:y
The server's public key will be saved with the name 202.100.1.1. Please wait...ip

Oct 24 2019 10:56:57-08:00 R2 %%01SSH/4/SAVE_PUBLICKEY(l)[1]:When deciding whether to save the server's public key 202.100.1.1, the user chose Y.
[R2]
Enter password: //輸入密碼
<R1> //驗證成功ci

相關文章
相關標籤/搜索