macos - 无密码 SSH 登录

标签 macos ssh centos

<分区>


这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。

关闭 5 年前

我想在没有密码的情况下登录我的服务器,我在服务器本地主机上成功了,但是当我尝试从我的 mac pro 登录时我失败了。

首先,我在我的服务器上进行测试。

  1. 第 1 步:生成 key enter image description here

  2. 第 2 步:cat 到 authorized_keys,并尝试无密码 SSH 登录 localhost,没有问题。 enter image description here

所以,我在我的 mac pro 上试试这个

  1. 第 3 步:生成 key enter image description here

  2. 第 4 步:将公钥复制到我的服务器,并将 cat 到 authorized_keys enter image description here

  3. 第 5 步:尝试在我的 mac pro 上登录我的服务器,仍然需要密码 enter image description here

  4. 第 6 步:我用谷歌搜索“无密码 SSH 登录”,并在 SSH 上找到说 The file named authorized_keys should have permissions 600 & ~/.ssh directory should generally have permission 700. 所以我做了以下步骤 enter image description here

  5. 第 7 步:仍然需要密码 enter image description here

有人可以解决这个问题吗?我的mac是OS X 10.11,我的服务器是CentOS 7.0 64bit


更新:

  1. 配置是 authorized_keys enter image description here

最佳答案

你的过程看起来不错,但对于 MAC 你似乎缺少一个关键步骤;

sudo systemsetup -setremotelogin on

您需要像上面那样通过 setremotelogin 配置 MAC 以接受远程登录。

关于macos - 无密码 SSH 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35666014/

上一篇:node.js - "libsass bindings not found. Try reinstalling node-sass"

下一篇:centos - Ansible yum 在实际可用时更新包

相关文章:

javascript - 火狐安全模式有什么作用?

phpseclib 即使在简单的命令上也不返回任何结果

objective-c - 在 macOS 的 Cocoa 应用程序中,我使用 NSFileWrapper 将包保存到磁盘。如何让查找器显示我的 bundle 的正确图标?

ssh - 如何在谷歌云平台的SSH虚拟机中打开文本文件?

git - 如何知道远程存储库中的所有项目?

python - 来自 1.1 的新 django 应用程序导致 500 错误

directory - 对符号链接(symbolic link)的文件夹写入权限 (Linux/CentOS)

gcc - 运行 rhel6 构建的可执行文件时在 rhel7 机器上导入错误

c - rand() 在 OSX 上是否返回零?

macos - 使用数组填充 NSTableView - 绑定(bind)表