SSH(stelnet)配置。
[R1] rsa local-key-pair create #生成一个加密秘钥。
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]:1024
Generating keys...
............++++++
..++++++
........................++++++++
......++++++++
[R1] user-interface vty 0 4
[R1-ui-vty0-4] authentication-mode aaa
[R1-ui-vty0-4] protocol inbound ssh #进程默认是不开启ssh的所以需要开启ssh。
[R1] aaa
[R1-aaa] local-user huawei password cipher 123 privilege level 3
Info: Add a new user.
[R1-aaa] local-user huawei service-type ssh #设置用户的服务类型为ssh。
[R1] stelnet server enable #开启stelnet 服务端。
Info: Succeeded in starting the STELNET server.
[R2] ssh client first-time enable #开启客户端认证。
[R2] stelnet 12.1.1.1 #ssh登录。
Please input the username:huawei
Trying 12.1.1.1 ...
Press CTRL+K to abort
Connected to 12.1.1.1 ...
The server is not authenticated. Continue to access it? (y/n)[n]:y #对服务端进行认证。
Aug 19 2022 10:13:23-08:00 R2 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[2]:The server ha
d not been authenticated in the process of exchanging keys. When deciding whethe
r 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 12.1.1.1. Please wait...
Aug 19 2022 10:13:49-08:00 R2 %%01SSH/4/SAVE_PUBLICKEY(l)[3]:When deciding wheth
er to save the server's public key 12.1.1.1, the user chose Y.
[R2]
Enter password: #输入密码。
<R1> sys #进入系统视图。
Enter system view, return user view with Ctrl+Z.
[R1]
SSH与Telnet的区别是ssh是不可通过抓包看到详细的一个操作过程的,而Telnet会被通过抓包看到操作过程。