【问题标题】:Enable Passwordless Authentication with ssh [duplicate]使用 ssh 启用无密码身份验证 [重复]
【发布时间】:2012-07-28 13:06:03
【问题描述】:

如何使用 SSH 启用无密码身份验证。

这是我在寻找 /.ssh 文件夹时所拥有的。

bash-3.00$ cd ~/.ssh
bash-3.00$ pwd
/home/uname/.ssh
bash-3.00$ ls -lt
total 2
-rw-r--r--   1 uname   gid-uname     489 Jul 26 18:55 known_hosts

我不知道接下来我要做什么?我需要更改known_hosts 文件夹的权限吗?还是别的什么?

【问题讨论】:

    标签: linux authentication ssh public-key-encryption


    【解决方案1】:

    要在远程和本地机器之间启用无密码 ssh,您必须在本地机器上执行以下步骤:-

    第一步> root@localmachine:~> ssh-keygen -t rsa

    注意 - 考虑到远程机器中已经存在 .ssh 目录,如果没有,那么执行此操作 (ssh root@remotemachine mkdir -p .ssh)

    第二步> cat .ssh/id_rsa.pub | ssh root@remotemachine 'cat >> .ssh/authorized_keys'

    第三步> root@localmachine:~> ssh root@remotemachine

    【讨论】:

      【解决方案2】:
      • 使用ssh-keygen 生成您的密钥
      • 使用 ssh-copy-id 将您的 SSH 身份复制到主机(您需要无密码登录)。

      man ssh-keygenman ssh-copy-id 在您的系统上寻求帮助。

      【讨论】:

        【解决方案3】:
        【解决方案4】:

        将您的公钥添加到名为authorized_keys 的文件中。

        确保没有设置groupother 权限。

        【讨论】:

        • 这不是stackoverflow的问题...
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-12-17
        • 1970-01-01
        • 2019-08-26
        • 1970-01-01
        • 1970-01-01
        • 2017-10-30
        • 2016-12-11
        相关资源
        最近更新 更多