zoukankan      html  css  js  c++  java
  • 网络基础--Telnet、SSH、FTP

    Telnet

    Telnet:远程登录 对本地或远程的设备进行配置、监控、维护

    • ping通设备
    • 配置Telnet密码验证
    • 基于TCP协议 (确少安全的认证方式)
    [R1]user-interface vty 0 4 //进入vty用户界面视图
    <R2>telnet  10.1.1.1  //远程Telnet访问r1
    
    

    AAA认证

    AAA ,认证(Authentication):验证用户的身份与可使用的网络服务;授权(Authorization):依据认证结果开放网络服务给用户;计帐(Accounting):记录用户对各种网络服务的用量,并提供给计费系统。整个系统在网络管理与安全问题中十分有效。

    配置 Telnet 远程管理

    [R1]user-interface vty 0 4//进入用户界面
    [R1-ui-vty0-4]authentication-mode aaa//身份验证的方式 aaa模式
    [R1-ui-vty0-4]q//退出
    [R1]aaa//进入aaa
    [R1-aaa]local-user telnet password cipher huawei//本地用户Telnet的密码
    [R1-aaa]local-user telnet service-type telnet //本地用户Telnet服务型Telnet
    [R1-aaa]local-user telnet privilege level 3  // 本地用户Telnet级别 3(3是管理员及级别)
    <R2>telnet 10.1.1.1
    

    SSH

    ssh:secure shell 网络安全协议
    stelnet:secure Telnet 安全的远程登录

    • 使用password方式验证,需要在山上服务器生成本地rsa密钥
    • 可用display 命令查看密钥对的情况
    • 用户的默认级别为3 管理员
    • 默认情况下ssh是关闭的 需要开启,用户端才能以ssh的方式建立连接

    配置 SSH 远程管理

    [R2]user-interface vty 0 4//进入用户界面
    [R2-ui-vty0-4]authentication-mode aaa//身份验证方式aaa
    [R2-ui-vty0-4]protocol inbound ssh//入站ssh协议
    [R2-ui-vty0-4]q
    [R2]aaa
    [R2-aaa]local-user ssh password cipher huawei
    [R2-aaa]local-user ssh privilege level 4
    [R2-aaa]local-user ssh service-type ssh
    [R2-aaa]q
    
    #配置ssh server
    [R2]rsa local-key-pair create  //生成本地RSA主机密钥对
    Confirm to replace them? (y/n)[n]:y  //确认替换他吗  是
    [R2]stelnet server enable  //stelnet服务启用
    
    #配置ssh client
    [R1]ssh client first-time enable //ssh客户端首次启用
    [R1]stelnet 10.1.1.2
    Please input the username:ssh
    The server is not authenticated. Continue to access it?    //服务器没有经过身份验证,是否访问他?
    
    (y/n)[n]:y
    Save the server's public key? (y/n)[n]:y //保存服务器的公钥?
    Enter password:
    <R2>
    
    #配置sftp和client
    [R2]aaa
    [R2-aaa]local-user huewei2 password cipher huawei2
    [R2-aaa]local-user huawei2 privilege level 3
    [R2-aaa]local-user huewei2 ftp-directory  flash //指定ftp用户可访问的目录,默认为空,如果不配置,就会无法登录
    [R2-aaa]ssh user huawei2 authentication-type password  // 创建ssh用户,指定认证方式
    
    
    

    关于ssh的展示命令:

    • display rsa local-key-pair create 展示密钥
    • display ssh user-information huawei 查看指定的ssh服务端的用户配置信息
    • display ssh server status 查看ssh服务器全局配置信息
    1. 配置ssh server
    2. 配置ssh client
    3. 配置sftp server 与 client

    FTP

    FTP:file transfer protocol 文件传输协议,属于应用层,采用c/s结构

    • c/s:客户端/服务器
    • FTP server 能够提供远程用户端访问和操作的功能,用户可以通过主机或其他设备的FTP用户端程序登录到服务器上,进行文件的上传、下载和目录访问
    1. ls :查看ftp服务器文件夹状态 语法:ls
    2. cd :进入指定文件夹 语法:cd 文件名
    3. dir :查看文件属性 语法:dir
    4. get :下载文件到路由器 语法:get 文件名
    5. put :上传到ftp服务器 语法:put 文件名

    配置静态路由:

    华为

    [r1]ip route-static  172.16.1.0  24 g0/0/0 10.1.1.2
    // ip  路由  静态的网段地址   通过的接口  下一跳地址
    

    思科

    route(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2  
    //ip  route  静态网段地址  网关   下一跳地址
    

    配置默认路由:

    华为

    [r1]ip route-static  0.0.0.0 0 g0/0/0 10.1.1.2
    //ip  路由    缺省路由   经过的接口     下一跳的地址
    

    思科

    route(config)#ip route 0.0.0.0 0.0.0.0  1.1.1.2  
    //ip  route  缺省地址  缺省网关  下一跳的地址
    

    配置console管理

    [R1]user-interface console 0 //进入用户控制台
    [R1-ui-console0]authentication-mode aaa//设置省份验证的方式 aaa
    [R1-ui-console0]q //退出
    [R1]aaa//进入aaa
    [R1-aaa]local-user console password cipher huawei//本地用户控制台密码
    [R1-aaa]local-user console privilege level 15//本地用户控制台特权等级15
    
    

    本文均本人原创,如有错误,欢迎留言指出。

    谢谢你的喜欢!
  • 相关阅读:
    SimpleDateFormat
    上传带进度条
    cookie和session
    poi导出数据
    commons-fileupload上传文件
    java异常处理
    常用的数据库MySql数据库语句总结
    流的文件操作
    Java输入输出流总结(转载)
    集合总结
  • 原文地址:https://www.cnblogs.com/linwenye/p/12481950.html
Copyright © 2011-2022 走看看