• 关于ssh的一些问题


    一、@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the ECDSA key sent by the remote host is
    fc:c9:2a:4a:5f:f3:08:00:37:7d:b0:71:f9:2a:51:34.
    Please contact your system administrator.

    怎么解决这个问题呢?

    直接进入.ssh/known_hosts,把文件里的内容删除,再执行ssh 用户@地址 即可

    二、公钥登录

    SSH还提供了公钥登录,可以省去输入密码的步骤。

      $ ssh-keygen

    运行上面的命令以后,系统会出现一系列提示,可以一路回车。其中有一个问题是,要不要对私钥设置口令(passphrase),如果担心私钥的安全,这里可以设置一个。

    运行结束以后,在$HOME/.ssh/目录下,会新生成两个文件:id_rsa.pub和id_rsa。前者是你的公钥,后者是你的私钥。

    这时再输入下面的命令,将公钥传送到远程主机host上面:

      $ ssh-copy-id user@host

    好了,从此你再登录,就不需要输入密码了。

    如果还是不行,就打开远程主机的/etc/ssh/sshd_config这个文件,检查下面几行前面"#"注释是否取掉。

      RSAAuthentication yes
      PubkeyAuthentication yes
      AuthorizedKeysFile .ssh/authorized_keys

    然后,重启远程主机的ssh服务。

      // ubuntu系统
      service ssh restart

      // debian系统
      /etc/init.d/ssh restart

  • 相关阅读:
    104_如何彻底删除VMware
    学习笔记(25)- NLP的几个概念
    学习笔记(24)- plato-训练中文模型
    学习笔记(23)- plato-准备中文语料
    学习笔记(22)- plato-训练端到端的模型
    学习笔记(21)- texar 文本生成
    学习笔记(35)-安装pyhanlp
    NLP直播-1 词向量与ELMo模型
    线上学习-语言模型 language model
    学习笔记(20)- Google LaserTagger
  • 原文地址:https://www.cnblogs.com/chenzhenzhen/p/3746759.html
Copyright © 2020-2023  润新知