/usr/bin/env: ruby: No such file or directory at SSH login

六眼飞鱼酱① 提交于 2020-01-04 15:33:01

问题


I'm trying to run a ruby script from inside of a bash script at SSH login. I did put the ForceCommand /etc/ssh/MyScript.sh && $SSH_ORIGINAL_COMMAND inside sshd_config and inside MyScript.sh

#!/bin/bash   
./MyRubyScript.rb

In my MyRubyScript.rb

#!/usr/bin/env ruby
#Some Ruby logic
puts 'Hey'

I wanted that MyRubyScript.rb to execute at the event that any one tries to login through SSH. But whenever I try to SSH login into the server, I get the following error.

/usr/bin/env: ruby: No such file or directory

Please help me out!

P.S. I tried to put the Ruby file directly into the sshd_config but it's still the same.

来源:https://stackoverflow.com/questions/37488014/usr-bin-env-ruby-no-such-file-or-directory-at-ssh-login

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!