Possible Duplicate:
Why does an SSH remote command get fewer environment variables then when run manually?
If I put command
ssh user@$IP ant
then I receive
bash: ant: command not found
but when I log into
ssh user@$IP
and put
ant
then work fine.
Ant is installed on remote and local machines. Where is the problem?
I've tried to find solution in google and found nothing.
Thanks in advance for help!
--EDIT--
I need to invoke some bash scripts, don't want to change all paths to full path.
There could be three possible reasons why it cannot find the command: It's a typo and the command name is misspelled. The command is not even installed. The command is basically an executable script and its location is not known.
When you're trying to run a command (with or without sudo ) and get an error message that reads "Command not found," this means the script or file you're trying to execute doesn't exist in the location specified by your PATH variable.
By default profiles aren't loaded when connecting via ssh. To enable this behaviour, set the following option in /etc/ssh/sshd_config:
PermitUserEnvironment yes
afterward restart ssh
/etc/init.d/ssh restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With