Hello,
we are using net/ssh in Ruby to execute scripts on a FreeBSD machine, in order to do some checks for Nagios. Actually it is a brand new Pfsense applicance.
The code is roughly the following:
When we execute this, we get a message, that the parameter "l" in "ls -al" is wrong. This is strange to me, as this works on a normal command line. Passing "ls -a" works however and produces the desired output.
"echo $0" shows not output, so I suspect, there is something wrong with the shell here.
Remotely executing "env" displays the following
We also tried to execute "tcsh -c <command>" but he complains about the "-c" parameter.
So I am confused, which shell is actually run, when remotely executing via ssh. And how I can run an remote command via tcsh?
Any help is appreciated.
we are using net/ssh in Ruby to execute scripts on a FreeBSD machine, in order to do some checks for Nagios. Actually it is a brand new Pfsense applicance.
The code is roughly the following:
Code:
Net::SSH.start(@host, @user, {:password=>@pass}) do |ssh|
erg=ssh.exec! "ls -al"
p erg
end
"echo $0" shows not output, so I suspect, there is something wrong with the shell here.
Remotely executing "env" displays the following
Code:
SSH_CLIENT=192.168.12.252 53798 22
LOGNAME=admin
FTP_PASSIVE_MODE=YES
MAIL=/var/mail/admin
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
PWD=/root
TERM=su
USER=admin
HOME=/root
SSH_CONNECTION=192.168.12.252 53798 192.168.12.254 22
SHELL=/etc/rc.initial
BLOCKSIZE=K
We also tried to execute "tcsh -c <command>" but he complains about the "-c" parameter.
So I am confused, which shell is actually run, when remotely executing via ssh. And how I can run an remote command via tcsh?
Any help is appreciated.