Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu capistrano未使用ssh密钥进行日志记录_Ubuntu_Ssh_Capistrano - Fatal编程技术网

Ubuntu capistrano未使用ssh密钥进行日志记录

Ubuntu capistrano未使用ssh密钥进行日志记录,ubuntu,ssh,capistrano,Ubuntu,Ssh,Capistrano,我不断地发现这个错误: 用户身份验证失败deploy@179.92.100.40 set :stage, :test server '179.92.100.40', port: 25000, user: 'deploy' set :branch, "dev" set :deploy_to, "/srv/www/test" set :format, :pretty set :log_level, :debug set :ke

我不断地发现这个错误:

用户身份验证失败deploy@179.92.100.40

  set :stage, :test
    server '179.92.100.40', port: 25000, user: 'deploy'
    set :branch, "dev"
    set :deploy_to, "/srv/www/test"
    set :format,        :pretty
    set :log_level,     :debug
    set :keep_releases, 5

    set :repo_url, "https://donatas@bitbucket.org/test.git"
    set :scm, :git
    set :git_strategy, SubmoduleStrategy

    set :ssh_options,     { forward_agent: true, user: fetch(:user), keys: %w('/root/.ssh/id_rsa.pub'), auth_methods: %w(publickey) }
我已将本地id_rsa.pub添加到远程机器的授权_密钥中,因此如果我在本地机器中键入类似的内容:

 cat id_rsa.pub | ssh deploy@179.92.100.40 -p 25000  "mkdir -p /home/deploy/.ssh && cat >>  ~/.ssh/authorized_keys"
那么,现在在本地计算机中,如果我运行这样的操作:

ssh deploy@179.92.100.40 -p 25000 'hostname; uptime'

我没有输入密码就得到了这些命令的结果,但是使用capistrano我无法使用ssh登录。不过,它可以与密码配合使用。

这些
:ssh\u选项都不是必需的,事实上它们可能会适得其反。例如,除非您在其他未显示的位置设置
:user
变量,否则
fetch(:user)
将为
nil
,这不是您想要的


您可以删除整个
:ssh\u选项并重试吗?

这些
:ssh\u选项都不是必需的,事实上它们可能会适得其反。例如,除非您在其他未显示的位置设置
:user
变量,否则
fetch(:user)
将为
nil
,这不是您想要的

您可以删除整个
:ssh\u选项并重试吗