无密码SSH登录 [英] Passwordless SSH login

查看:103
本文介绍了无密码SSH登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想不使用密码登录服务器,我已经在服务器localhost上成功登录,但是尝试从Mac Pro登录时失败了.

I want to login my server without the password, I have succeeded on the server localhost, but I failed when I try to login from my mac pro.

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

  1. 步骤1:生成密钥

  1. Step 1: generate the Key

第2步:轻按"authorized_keys",然后尝试使用无密码SSH登录localhost,就没有问题.

Step 2: cat to the authorized_keys, and Try Passwordless SSH login localhost, there is no problem.

因此,我在Mac Pro上尝试了此操作

  1. 步骤3:生成密钥

  1. Step 3: generate the key

第4步:将公钥复制到我的服务器,然后将其复制到authorized_keys

Step 4: copy the public key to my sever, and cat to the authorized_keys

第5步:尝试在我的Mac Pro上登录到我的服务器,仍然需要密码

Step 5: try login to my sever on my mac pro, still need the password

步骤6:我在Google上搜索无密码SSH登录名",然后在 SSH 表示,名为authorized_keys的文件应具有600& amp;权限. 〜/.ssh目录通常应具有权限700.因此,我执行以下步骤

Step 6: I google the "Passwordless SSH login", and find on the SSH said that The file named authorized_keys should have permissions 600 & ~/.ssh directory should generally have permission 700. So I do the following step

第7步:仍然需要密码

有人可以帮助解决此问题吗?我的Mac是OS X 10.11,我的服务器是CentOS 7.0 64位

更新:

  1. 配置为authorized_keys
  1. The config is the authorized_keys

推荐答案

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

You process seems fine, but for MAC you seem to be missing one key step;

sudo systemsetup -setremotelogin on

您需要将MAC配置为如上所述通过setremotelogin接受远程登录.

you need to configure MAC to accept remote logins through setremotelogin as above.

这篇关于无密码SSH登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆