代码之家  ›  专栏  ›  技术社区  ›  AlxVallejo

从Bitbucket部署SSH。禁用密码短语?

  •  0
  • AlxVallejo  · 技术社区  · 6 年前

    在Bitbucket上运行部署时,我的权限仍被拒绝。

    在管道中使用的任何SSH密钥都不应具有密码短语。

    sshd_config 文件有:

    # To enable empty passwords, change to yes (NOT RECOMMENDED)
    PermitEmptyPasswords no
    

    我应该把这个改成是吗?

    比特桶 documentation 他说我应该 ssh-copy-id -i my_ssh_key user@host

    我不知道这为什么不清楚。

    编辑:以下是bitbucket生成的错误:

    + cat ./deploy.sh | ssh username@remote.com
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    Warning: Permanently added the RSA host key for IP address ‘XXX.XXX.XX.XX’ to the list of known hosts.
    Permission denied, please try again.
    Permission denied, please try again.
    Permission denied (publickey,password).
    

    RSAAuthentication yes
    PubkeyAuthentication yes
    #AuthorizedKeysFile     %h/.ssh/authorized_keys
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   AlxVallejo    6 年前

    好的,明白了。出于某种原因,我的ssh逻辑是反向的。我在Bitbucket中重新创建了ssh密钥对,将公钥添加到远程服务器的 ~/ssh/authorized_keys 600 . 一旦我修正了这个权限,我就有了我的第一个成功构建。希望这对别人有帮助。