首页 > 其他分享 >思科(cisco)交换机配置远程ssh连接

思科(cisco)交换机配置远程ssh连接

时间:2023-03-14 14:33:06浏览次数:34  
标签:cisco vlan Switch 交换机 ssh test line config

配置单机远程ssh连接

实验环境如图

一台pc机、一台Cisco的switch;

Cisco配置命令如下

Switch>
Switch>enable    //进入特权模式
Switch#configure terminal   //切换全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#interface vlan 2    //创建并进入vlan 2
Switch(config-if)#ip address 192.168.75.5 255.255.255.0   //为vlan 2 配置管理ip地址
Switch(config-if)#no shutdown  //启用vlan 2
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/1    //进入f0/1口
Switch(config-if)#switchport mode access     //配置接口工作模式为access模式允许vlan通过
Switch(config-if)#switchport access vlan 2   //封装vlan 2
% Access VLAN does not exist. Creating vlan 2
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up

Switch(config-if)#
Switch(config-if)#exit
Switch(config)#hostname test   //配置交换机hostname
test(config)#ip ssh version 2  //启用v2版的ssh服务
Please create RSA keys (of at least 768 bits size) to enable SSH v2.
test(config)#
test(config)#ip domain-name test.com   //配置交换机domain-name
test(config)#
test(config)#crypto key generate rsa      //生成密钥
The name for the keys will be: test.test.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 1024    //设置密钥位数
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

test(config)#
*Mar 1 0:9:30.668: %SSH-5-ENABLED: SSH 2 has been enabled

test(config)#enable  password admin   //配置特权模式密码(secret密码为加密的,password为明文的)
test(config)#
test(config)#username admin secret admin     //配置用户名和密码(secret密码为加密的,password为明文的)
test(config)#
test(config)#line vty 0 4   //进入管理线路vty 0 4
test(config-line)#
test(config-line)#transport input ssh   //只允许ssh登录
test(config-line)#login local     //使用本地数据库
test(config-line)#end
test#
%SYS-5-CONFIG_I: Configured from console by console

test#write    //保存配置
Building configuration...
[OK]
test#

实验结果

标签:cisco,vlan,Switch,交换机,ssh,test,line,config
From: https://www.cnblogs.com/du-z/p/17214819.html

相关文章

  • CISCO-配置路由器的双向PAP和CHAP身份认证
    CISCO-配置路由器的CHAP身份认证一、拓扑图二、IP地址规划表设备接口IP地址R1S0/0/0172.16.10.1/30R1G0/0192.168.10.254/24R2S0/0/0172.16.10.2/30R2G0/0192.168.20.254/24......
  • LINUX设置ssh免密登录
    1.打开ssh服务,关闭防火墙 systemctl stopfirewalld2.保证同网段,登录控制机执行:ssh-keygen 一路回车(生成公钥、私钥)3.ssh-copy-id -i 要访问的主机地址即可......
  • linux ssh配置文件配置参数
    目录linuxssh配置文件配置参数HostKeyMaxAuthTriesNumberOfPasswordPromptslinuxssh配置文件配置参数HostKey/etc/ssh/ssh_host_rsa_keyHostKey/etc/ssh/ssh_host_e......
  • VScode连接远程服务器编程,bad owner or permissions on SSH config
    上智能计算系统课程,了解到VScode可以连接远程服务器来编写代码,分享一下使用过程和踩坑经历。安装SSHwindows系统可以直接在设置->安装可选功能中,选择openssh客户端进行安......
  • 使用脚本让一台电脑存在多个ssh-key
    这是一篇关于如何使用脚本来控制一台电脑上多个ssh-key。在一台电脑上,会同时用公司git,github,gitlab,gitee,但是每一个邮件和名字不一样,那么如何管理不同的ssh-key呢,采用的脚......
  • Linux用户以及ssh安全相关设置
    Linux用户相关操作摘要最近重保,需要进行网络安全防护.部分同事处理过程总是顺序有一些不太对的情况.同时发现自对Linux用户设置也存在很多不清不楚的地方所以趁着......
  • 在Linux中如何注销其他 SSH 用户
    如果你通过ssh登录了一个远程Linux系统,只需要使用exit 命令即可退出ssh。那么,如果你想要注销其他通过ssh登录到系统中的用户呢?在ssh会话中注销用户首先,检查L......
  • 在Linux中如何注销其他 SSH 用户
    今天我们简单介绍一下如何踢掉其他通过ssh连接到系统中的用户。 Pixelatedword Linux madefromcubes,mosaicpattern如果你通过ssh登录了一个远程L......
  • ssh连接故障排除
    1.首先ping两台机器看网络是否通pingx.x.x.x2.查看ssh服务进程是否开启servicesshdrestartpsaux|grepsshd3.查看ssh进程的网络状态(端口号)netstat-anplu......
  • ssh登录提示每次不一样
    环境介绍有一天有一哥们,菜鸟发现了一个环境,里边每次ssh登录和每次打开终端都会输出不同的提示语。就感觉挺有意思。那个软件是fortune-zh。但是这个软件呢只能在ubuntu上装......