I try connect with ssh2 and run script in one line command.
/usr/bin/ssh2 --password ${password} -l root ${address} cd ${dir} ; python script.py
But directory isn't changed. Why ? I want write with two command. It does only first command (cd)
Solved
Hello you should use && instead of ; and put command in "
example:
/usr/bin/ssh2 --password ${password} -l root ${address} "cd ${dir} && python script.py"
Comments
Post a Comment