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
capistrano 3设置ssh端口,但仍使用22_Ssh_Port_Capistrano3 - Fatal编程技术网

capistrano 3设置ssh端口,但仍使用22

capistrano 3设置ssh端口,但仍使用22,ssh,port,capistrano3,Ssh,Port,Capistrano3,我试图通过一个端口设置对服务器的访问(ssh在端口222上),但仍然在deploy.rb中 设置:应用程序“计费” 集合:repo_url,'git@github.com:random/stat.git' 设置:保持释放,5 设置:ssh_选项,{ 转发代理:正确, 端口:222 } SSHKit.config.command_map[:rake]=“bundle exec rake”#8 SSHKit.config.command_map[:rails]=“bundle exec rails”

我试图通过一个端口设置对服务器的访问(ssh在端口222上),但仍然在
deploy.rb中

设置:应用程序“计费”
集合:repo_url,'git@github.com:random/stat.git'
设置:保持释放,5
设置:ssh_选项,{
转发代理:正确,
端口:222
}
SSHKit.config.command_map[:rake]=“bundle exec rake”#8
SSHKit.config.command_map[:rails]=“bundle exec rails”

我还是会出错

SSHKit::Runner::ExecuteError: Exception while executing on host IP:
Operation timed out - connect(2) for "IP" port 22

如何解决此错误?我做错了什么?

我还遇到了
ssh\u选项的问题

我切换到使用
server
方法,所以它看起来像这样:

# config/deploy/production.rb
server "#{server_ip_here}", user: "deploy", roles: %w{web app db}, port: 222

我也给出另一个答案:

角色:web%w{deploy@123.456.78.9:222}

是的,你是对的。在我的例子中,这是一个服务器端问题。不得不花一些时间调整服务器这对我来说是个救命稻草。出于某种原因,使用基于角色的语法时,上面的语法失败了,但使用您列出的一行程序仍然有效。