1

The following command is failing:

ssh -t user@server-01 sudo -iu suser "cd /opt/jboss ; ./portal.sh stop"

I getting:

bash: ./portal.sh: No such file or directory

How can I change directory remotely and execute a remote command in that directory?

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
ABOCb
  • 21
  • 7

1 Answers1

1

The solution is:

ssh -t user@server-01 sudo -iu suser "eval 'cd /opt/jboss ; ./portal.sh stop'"
ABOCb
  • 21
  • 7