天天看点

h3c ssh

l              SSH服务器端配置

# 在交换机上创建VLAN接口,并为其分配IP地址,作为客户端连接的SSH服务器地址。

<Switch> system-view

[Switch] interface vlan-interface 1

[Switch-Vlan-interface1] ip address 192.168.0.1 255.255.255.0    

[Switch-Vlan-interface1] quit

[Switch]ip route-static 0.0.0.0 0.0.0.0  x.x.x.x            

生成服务器端的RSA和DSA密钥对是完成SSH登录的必要操作。

# 生成RSA和DSA密钥对。

[Switch] public-key local create rsa

[Switch] public-key local create dsa

# 设置用户接口上的认证模式为AAA认证。

[Switch] user-interface vty 0 4

[Switch-ui-vty0-4] authentication-mode scheme

# 设置用户接口上支持SSH协议。

[Switch-ui-vty0-4] protocol inbound ssh

[Switch-ui-vty0-4] quit

# 创建用户client001,设置认证密码为abc,登录协议为SSH,能访问的命令级别为3。

[Switch] local-user user

[Switch-luser-client001] password simple passwd

[Switch-luser-client001] service-type ssh level 3

[Switch-luser-client001] quit

# 指定用户user的认证方式为password

[Switch] ssh user user authentication-type password

# 退出保存

[Switch]quit

[Switch]save