4

Is there a difference between doing ssh to get into a remote node and run commands there e.g. ssh azg@zeus then run commands as opposed to the scripting flavour ssh azg@zeus 'command1 && command2 && command3 && etc'?

I ask this because I see the applications don't behave exactly the same e.g. Akka works but produces some strange errors in the logs when I run the same server start using the scripting second choice. e.g. Will both flavours load .bashrc equally? Note I see the differences even if my first command is to source .bashrc

SkyWalker
  • 13,729
  • 18
  • 91
  • 187
  • The latter will show up in your command history and may be a bad idea if passwords are involved in any of the commands – vogomatix Mar 21 '14 at 15:02
  • There are no passwords involved (I have setup private and public keys to be able to do that). – SkyWalker Mar 21 '14 at 15:04
  • I did not mean the actual ssh command, which I expected to be a public/private key session; I was referring to the commands you pass to remote server e.g. if you try to do something to a remote (MySQL) database. – vogomatix Mar 21 '14 at 15:05

1 Answers1

0

Its question has been closed as off-topic, but this answer covers it, I think.

If you need the added security that @vogomatix suggests (usually recommended), you'll need to establish the environment you want as part of the command, within the confines of the non-interactive shell.

Community
  • 1
  • 1
John C
  • 1,931
  • 1
  • 22
  • 34