【问题标题】:adding ssh public key to server by another user另一个用户将 ssh 公钥添加到服务器
【发布时间】:2017-09-06 07:07:34
【问题描述】:

我有权 ssh 进入服务器,但我想将另一个人的公钥添加到服务器上,以便他也可以 ssh 进入服务器我该怎么做...我尝试使用以下命令

<entered another users public key> | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

我得到这个错误

 w: No such file or directory

但是这个命令对我来说不能正常工作......我该怎么做?

【问题讨论】:

    标签: ssh server ubuntu-14.04 public-key ubuntu-server


    【解决方案1】:

    你可能需要echo:

    echo "<entered another users public key>" \
        | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-21
      • 2014-04-04
      • 1970-01-01
      • 2021-03-02
      相关资源
      最近更新 更多