实验目的
server端配置ssh服务,client端访问
拓扑图
配置IP
[server-ui-vty0-4]int g0/0/0
[server-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[client]int g0/0/0
[client-GigabitEthernet0/0/0]ip address 192.168.1.3 24
添加用户认证AAA
[server]aaa
[server-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[server-aaa]local-user huawei privilege level 15
[server-aaa]local-user huawei service-type ssh
设置使用vty方式登录
[server-aaa]user-interface vty 0 4
[server-ui-vty0-4]authentication-mode aaa
[server-ui-vty0-4]user privilege level 15
[server-ui-vty0-4]protocol inbound ssh
开启服务设置SSH登录方式
[server]stelnet server enable
Info: Succeeded in starting the STELNET server.
[server]ssh user huawei authentication-type password
Authentication type setted, and will be in effect next time
客户端通过SSH访问
[client-GigabitEthernet0/0/0]stelnet server enable //初次访问需要设置
The STELNET server is already started.
[client]stelnet 192.168.1.1
Please input the username:huawei
Trying 192.168.1.1 …
Press CTRL+K to abort
Connected to 192.168.1.1 …
The server is not authenticated. Continue to access it? (y/n)[n]:y //服务器未认证是否访问
client %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[1]:The server had not been authenticated in the process of exchanging keys. When deciding whether to continue, the user chose Y.
[client] //服务器在交换密钥的过程中没有经过身份验证
Save the server’s public key? (y/n)[n]:y //保存服务器的公钥
The server’s public key will be saved with the name 192.168.1.1. Please wait…
client %%01SSH/4/SAVE_PUBLICKEY(l)[2]:When deciding whether to save the server’s public key 192.168.1.1, the user chose Y. //决定是否保存服务器的公钥192.168.1.1
[client]
Enter password: