• 学习ssh配置


    在这里插入图片描述
    三台设备ar1、ar2、ar3
    ar1 通过ssh密码方式登陆ar3
    ar2 通过免密码方式登陆ar3

    ar3的配置如下:进入路由器

    
    rsa local-key-pair creat
    选择y(yes)
    Input the bits in the modulus[default = 512]:2048  //需要创建密钥的长度
    
    user-interface vty 0 4       	//创建虚拟用户  5个(0 1 2 3 4)
    authentication-mode aaa  		//验证模式是aaa
    protocol inbound ssh 			//协议选择ssh
    
    aaa  										//进入三a验证
    local-user test01 password cipher 12345678	//设置账号
    local-user test01 privilege level 15		//设置权限
    local-user test01 service-type ssh			//设置服务类型
    
    test02设置同上
    
    ssh user test01 authentication-type password//设置test01的验证方式密码
    ssh user test02 authentication-type rsa 	//设置test02的验证方式rsa
    stelnet server enable 			//开启ssh功能
    ssh server port 1025			//更改ssh服务的端口
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    进入ar2配置
    由于ar2 配置不需要密码验证
    配置如下

    rsa local-key-pair creat 	//同样如同ar1配置密钥
    选择y(yes)
    Input the bits in the modulus[default = 512]:2048  //需要创建密钥的长度
    dis rsa local-key-pair public //查看设置好的密钥
    
    复制后设置到ar3中
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    重新进入ar3

    rsa peer-public-key rsa001 	//进入配置添加ar2密钥,设置密钥名字
    public-key-code begin		//开始输入code
    复制ar2中的信息
    public-key-code end			//结束输入code
    peer-public-key end         //这个才能退出配置
    ssh user test02 assign rsa-key rsa001 //配置刚才的密钥绑定用户
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    再一次进入ar2配置

    ssh client first-time enable  //开启保存密钥
    stelnet 1.1.1.3 1025  端口号必须对
    
    
    • 1
    • 2
    • 3

    配置ar3的时候注意
    进入 user-interface vty 0 4 配置虚拟接口的时候
    protocol inbound ssh 协议类型只能选一次
    还有
    user privilege level 15 这里设置用户的等级高点影响3a的用户等级最好高一点

  • 相关阅读:
    python作业
    区块链、隐私计算、联邦学习、人工智能的关联
    基于Matlab实现多个数字水印案例(附上源码+数据集)
    【网络安全】伪装IP网络攻击的识别方法
    生成式AI - Knowledge Graph Prompting:一种基于大模型的多文档问答方法
    Spring Security 介绍中的 servlet 和 reactive
    Rsync学习笔记2
    三分钟快速了解什么是MES系统
    Flink SQL Hudi 实战
    【Java】基于SSM的单位人事管理系统
  • 原文地址:https://blog.csdn.net/a1017938493/article/details/133200781