HCNA配置ssh远程登陆

1、拓扑图

最终实现通过AR1 来SSH登陆到AR2 上

2、配置AR2为开启SSH服务

Please press enter to start cmd line!
##############
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int
[Huawei]interface g
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip addr
[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[Huawei-GigabitEthernet0/0/0]
Dec  8 2017 22:12:30-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]q
[Huawei]stel
[Huawei]stelnet ser
[Huawei]stelnet server en
[Huawei]stelnet server enable
Info: Succeeded in starting the STELNET server.
[Huawei]rsa ?
  local-key-pair   Local RSA public key pair operations
  peer-public-key  Remote peer RSA public key configuration.
[Huawei]rsa loc
[Huawei]rsa local-key-pair ?
  create   Create new local public key pairs
  destroy  Destroy the local public key pairs
[Huawei]rsa local-key-pair cre
[Huawei]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...
........................++++++
.........++++++
............++++++++
...............++++++++

[Huawei]aaa
[Huawei-aaa]loc
[Huawei-aaa]local-user user-ssh pass
[Huawei-aaa]local-user user-ssh password ci
[Huawei-aaa]local-user user-ssh password cipher huawei
Info: Add a new user.
[Huawei-aaa]loc
[Huawei-aaa]local-user user-ssh pri
[Huawei-aaa]local-user user-ssh privilege level
[Huawei-aaa]local-user user-ssh privilege level 2
[Huawei-aaa]loc
[Huawei-aaa]local-user user
[Huawei-aaa]local-user user-ssh serv
[Huawei-aaa]local-user user-ssh service-type ssh
[Huawei-aaa]q
[Huawei]user-in
[Huawei]user-interface vty
[Huawei]user-interface vty 0
[Huawei]user-interface vty 0 4
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]aut
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei-ui-vty0-4]pro
[Huawei-ui-vty0-4]protocol ?
  inbound  Incoming protocol
[Huawei-ui-vty0-4]protocol in
[Huawei-ui-vty0-4]protocol inbound ssh
[Huawei-ui-vty0-4]q
[Huawei]ssh user
[Huawei]ssh user user
[Huawei]ssh user user-
[Huawei]ssh user user-ssh au
[Huawei]ssh user user-ssh authentication-type ?
  all           All authentication, password or RSA
  password      Password authentication
  password-rsa  Both password and RSA
  rsa           RSA authentication
[Huawei]ssh user user-ssh authentication-type all
 Authentication type setted, and will be in effect next time[Huawei]sysnan    [Huawei]sysna    [Huawei]sysname [email protected][[email protected]]sysname [email protected][[email protected]]sysname AR2[AR2]

3、AR1作为SSH客户端接连AR2测试

Please press enter to start cmd line!
##########################
<Huawei>
Dec  8 2017 22:11:25-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt
hernet0/0/0 has turned into UP state.
<Huawei>

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR1
[AR1]int
[AR1]interface g
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[AR1-GigabitEthernet0/0/0]
Dec  8 2017 22:20:08-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state.
[AR1-GigabitEthernet0/0/0]q
[AR1]ping  12.1.1.2
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.2: bytes=56 Sequence=1 ttl=255 time=160 ms
    Reply from 12.1.1.2: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 12.1.1.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/56/160 ms

[AR1]ssh 12.1.1.2
         ^
Error: Unrecognized command found at ‘^‘ position.
[AR1]ssh
[AR1]ssh ?
  client  Set SSH client attribute
  server  Specify the server attribute
  user    SSH user
[AR1]ssh ssh
[AR1]ssh clei
[AR1]ssh clien
[AR1]ssh client ?
  STRING<1-64>  Specify SSH server IP address or name
  first-time    Set SSH client attribute of authenticating user for the first
                time access.
[AR1]ssh client fri
[AR1]ssh client fir
[AR1]ssh client first-time
                           ^
Error:Incomplete command found at ‘^‘ position.
[AR1]ssh client first-time
                           ^
Error:Incomplete command found at ‘^‘ position.
[AR1]ssh client first-time ?
  enable  Enable authentication for first time access.
[AR1]ssh client first-time en
[AR1]ssh client first-time enable
[AR1]ssh
[AR1]ssh ?
  client  Set SSH client attribute
  server  Specify the server attribute
  user    SSH user
[AR1]ste
[AR1]stelnet ?
  STRING<1-255>  IP address or host name of a remote system
  -a             Set the source IP address of SSH packets
  server         Set Stelnet server
[AR1]stelnet 12.1.1.2
Please input the username:user-ssh
Trying 12.1.1.2 ...
Press CTRL+K to abort
Connected to 12.1.1.2 ...
The server is not authenticated. Continue to access it? (y/n)[n]:y
Dec  8 2017 22:23:15-08:00 AR1 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[1]:The server h
ad not been authenticated in the process of exchanging keys. When deciding wheth
er to continue, the user chose Y.
[AR1]
Save the server‘s public key? (y/n)[n]:y
The server‘s public key will be saved with the name 12.1.1.2. Please wait...

Dec  8 2017 22:23:21-08:00 AR1 %%01SSH/4/SAVE_PUBLICKEY(l)[2]:When deciding whet
her to save the server‘s public key 12.1.1.2, the user chose Y.
[AR1]
Enter password:
<AR2>dis ip in
<AR2>dis ip interface bri
<AR2>dis ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol
GigabitEthernet0/0/0              12.1.1.2/24          up         up
GigabitEthernet0/0/1              unassigned           down       down
GigabitEthernet0/0/2              unassigned           down       down
NULL0                             unassigned           up         up(s)
<AR2>
时间: 2024-11-09 02:53:12

HCNA配置ssh远程登陆的相关文章

SSH 远程登陆

2019-03-10 20:41:39 一.什么是SSH 简单说,SSH是一种网络协议,用于计算机之间的加密登录. 如果一个用户从本地计算机,使用SSH协议登录另一台远程计算机,我们就可以认为,这种登录是安全的,即使被中途截获,密码也不会泄露. 最早的时候,互联网通信都是明文通信,一旦被截获,内容就暴露无疑.1995年,芬兰学者Tatu Ylonen设计了SSH协议,将登录信息全部加密,成为互联网安全的一个基本解决方案,迅速在全世界获得推广,目前已经成为Linux系统的标准配置. 需要指出的是,

配置 ssh无密码登陆

首先确保 linux系统中已经安装了ssh,否则先安装 ssh,ubuntu 系统可以执行 sudo apt-get install ssh 接下来开始配置 ssh无密码登陆 确保在 /home/user用户目录下存在.ssh目录,可以使用一下命令进行查看 ls -a /home/user 如果不存在可以自己手动创建一个 mkdir /home/user/.ssh 接下来没输入命令: ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 解释一下: ssh-keyge

模拟PIX804外网访问内网DMZ服务器以及ssh远程登陆

实验环境: 一台centos搭建 lnmp,做为DMZ内网服务器 swtich三层交换机连接linux web 与 pix804 router是路由连接pix与win7 ip规划 switch      vlanif 100       192.168.1.1/24     vlanif100 to DMZ linux web      eth0       192.168.1.3/24     eth0 to vlanif100 pix      Ethernet1       192.168

Linux2 在Linux(CentOS)上配置SSH免登陆

前言:      本文主要是我在安装hadoop之前,需要先配置SSH免登陆.通过网上搜索,发现不少类似的资料,但多少都有些小问题,所以结合自己的实践,记录在此,作为参考.如果能帮助到其他人,自然是更好啦. ============================================================长长的分割线===================================================================== 正文:      以

redhat root账号 SSH远程登陆不上处理记载

修改 服务器ssh服务的配置文件 /etc/ssh/sshd_config 1).permitRootLogin yes  注释:允许root登陆 2).AllowUser root             注释:允许root用户使用ssh远程登陆 2. service sshd restart  重启 ssh服务 加载修改的配置文件 3.service iptables stop 关闭 防火墙或允许对ssh服务程序22端口的访问

ssh远程登陆缓慢的解决办法

使用ssh远程登陆虚拟机突然变得很卡!这个原因一般是由于ssh配置文件里启动了DNS功能造成的!只需要将UseDNS这一功能给关闭即可(默认是打开此功能的) 重启ssh服务

Centos 7 配置SSH远程连接及RAID 5的创建

   Centos 7 配置SSH远程连接及RAID的创建 安装Centos系统 首先进入引导界面:选择第一项,安装Centos7 选择安装语言:默认即可 下面进入安装信息界面 时区选择: 选择安装界面,web版就行 点击完成,进入安装界面,这时设置root密码 安装完成后,重启系统 进入系统配置好IP, 下面配置SSH服务 首先查看ssh服务有没有安装: 已安装服务,如果没有安装ssh,那就运行命令:yum install ssh –y 查看ssh服务有没有开启 查询结果,没有开启. 现在开启

工控机改装家庭智能中心--配置ssh证书登陆

1.在客户端的~/.ssh目录下生成私钥与公钥 ssh-keygen -t rsa rsa为一种加密算法,另外一种加密算法为dsa.会在当前目录下生成一个是公钥id_rsa.pub,一个是私钥id_rsa. Generating public/private rsa key pair. Enter file in which to save the key (/home/wyet/.ssh/id_rsa): xxx 密钥文件名:xxx Enter passphrase (empty for no

路由交换学习第四天:路由器配置SSH认证登陆

华为路由器1:<Huawei>sys //进入系统视图[Huawei]interface g0/0/0 //进入g0/0/0配置[Huawei-GigabitEthernet0/0/0]ip address 202.100.1.1 30 //配置IP地址为202.100.1.1 30[Huawei-GigabitEthernet0/0/0]q[Huawei]aaa //进入aaa[HW-R1-aaa]local-user huawei password cipher huawei123 //创