I m writing a program to execute remote script .
(display remote file content)
Whenever i execute following statement it gives me an error.
PHP Code:
$command="cat /root/vm.cfg"
ssh -ttq root@10.180.8.236 $command
However following script work find.
PHP Code:
ssh -ttq root@10.180.8.236 cat /root/vm.cfg
I have added rsa key so that it should not ask for any password while doing ssh.
What is wrong with using variable in ssh.
What could be the issue here?