zoukankan      html  css  js  c++  java
  • SSH安全协议

    SSHD服务

    介绍:SSH 协议:安全外壳协议。为 Secure Shell 的缩写。SSH 为建立在应用层和传输层基础上的安全协议。

    默认端口22

    作用

    sshd服务使用SSH协议可以用来进行远程控制, 或在计算机之间传送文件 

    相比较之前用telnet方式来传输文件要安全很多,因为telnet使用明文传输,是加密传输。

    第一步、安装

    系统默认安装并且开机自启

    [root@localhost songqi]# yum install openssh openssh-clients openssh-server openssh-askpass

    SSH 配置文件

    SH 常用配置文件有两个/etc/ssh/ssh_config 和/etc/sshd_config。

    ssh_config 为客户端配置文件

    sshd_config 为服务器端配置文件

    从节点:接收秘钥的主机

    [root@ken-node2 ~]# ls .ssh/
    authorized_keys

    authorized_keys文件内容和主节点的 id_rsa.pub文件内容一致,即保存了公钥信息。

    使用ssh免密登陆远程主机

     第一步、生成秘钥

    [root@localhost /]# ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/root/.ssh/id_rsa):
    /root/.ssh/id_rsa already exists.
    Overwrite (y/n)? y
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /root/.ssh/id_rsa.
    Your public key has been saved in /root/.ssh/id_rsa.pub.
    The key fingerprint is:
    05:01:72:e7:b7:74:aa:62:ab:b1:6f:f6:dc:8a:1f:cb root@localhost.localdomain
    The key's randomart image is:
    +--[ RSA 2048]----+
    | . o.+. |
    | o o . |
    | . + . |
    | + + |
    | S o |
    | . |
    | . o o |
    | +o* + |
    | o=+oE.. |
    +-----------------+

    第二步、发送秘钥给目标主机

    [root@localhost /]# ssh-copy-id 192.168.7.2

    第一次需要密码(客户端密码)

    第三步、测试

    可以免密登陆目标主机或使用scp命令

  • 相关阅读:
    【计算机图形学】变换 (Transform)
    [图像处理]基于 PyTorch 的高斯核卷积
    [PyTorch] torch.squeee 和 torch.unsqueeze()
    【图像分析】边缘检测中的图像梯度以及各种梯度算子的介绍
    你买的课程看了吗?
    为什么用抓包工具看HTTPS包是明文的
    定制化Fiddler
    软件测试常见网络相关面试题
    单线程和多线程执行对比—Python多线程编程
    多线程实践—Python多线程编程
  • 原文地址:https://www.cnblogs.com/tomsongqi/p/11122476.html
Copyright © 2011-2022 走看看