zoukankan      html  css  js  c++  java
  • Mac 中ssh localhost连接失败的处理

    在Mac电脑上安装了一些东西后,结果ssh连不上了,ping ip地址又可以。使用ssh localhost命令老是提示Connection closed by ::1。使用ssh -v localhost,提示:

    OpenSSH_6.9p1, LibreSSL 2.1.8
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to localhost [::1] port 22.
    debug1: Connection established.
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_rsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_rsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_dsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_dsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_ecdsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_ecdsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_ed25519 type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /Users/macbookpro/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.9
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
    debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
    debug1: Authenticating to localhost:22 as 'macbookpro'
    debug1: SSH2_MSG_KEXINIT sent
    Connection closed by ::1

    总是链接不上,只能去看日志,结果提示

    error: Permissions 0644 for '/etc/ssh/ssh_host_dsa_key' are too open. : 31 time(s)
    error: Permissions 0644 for '/etc/ssh/ssh_host_rsa_key' are too open. : 31 time(s)
    error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key : 31 time(s)
    error: It is recommended that your private key files are NOT accessible by others. : 62 time(s)
    error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key : 31 time(s)
    error writing /proc/self/oom_adj: Operation not permitted : 54 time(s)

    然后在终端使用命令:'sudo chmod 600 /etc/ssh/ssh_host_?sa_key',终于可以连上了。这里记录一下,防止以后遇到同样的问题。

  • 相关阅读:
    [Vue]使用 vue-i18n 切换中英文
    轻松实现Ecshop商城多语言切换
    关于ecshop的mobile里user.php登录和注册验证码不显示
    ecshop用户中心菜单选项显示内容标签
    ECSHOP的JS文件代入问题
    在PHP中gmtime()与time()区别
    ECSHOP中 {insert name='ads' id=$ads_id num=$ads_num}含义
    ECshop 迁移到 PHP7版本时遇到的兼容性问题,ecshopphp7
    App开放接口api安全性—Token签名sign的设计与实现
    台湾拼音对照表
  • 原文地址:https://www.cnblogs.com/zjmsky/p/8279956.html
Copyright © 2011-2022 走看看