I have seen this question, and noted this line in the top answer:
If you are not logout in local, the remote login would fail.
I would like to access my machine remotely without logging out on local. I know this is possible, as I've been doing it for a while on xubuntu 16.04 LTS (I believe I had a modified version of this script at the time).
Unfortunately I can't seem to figure out why I am unable to do so in the current version.