I think the generic fix should be ~${ssh_user}, it will resolve to home directory of this particular user.
~/${ssh_user} was wrong because of the /. However I don't know why it is working atall for me, since months.
It never worked because I am using the ssm only script. I just removed the invalid slash after the ~ and now its working like a charm again. May you can confirm it.
I think the generic fix should be
~${ssh_user}
, it will resolve to home directory of this particular user.~/${ssh_user}
was wrong because of the/
. However I don't know why it is working atall for me, since months.