bash actually checks the calling process and will not source the env if
it is invoked by sshd or rshd as non-login shell (it checks if
the SSH_CLIENT environment variable is set and uses a different code
path internally).
you could also do something like:
ssh 192.168.2.91 "source /etc/profile; hello"
i dont think we have a bug open for this and technically it is expected
behaviour (not different from any other ubuntu install), but given how
annoying it is i guess you should file one and we should find a proper
workaround or fix to ship in the image ...
Comment from ogra in the mailing list:
bash actually checks the calling process and will not source the env if
it is invoked by sshd or rshd as non-login shell (it checks if
the SSH_CLIENT environment variable is set and uses a different code
path internally).
the follwing works:
$ ssh 192.168.2.91 env|grep PATH local/sbin: /usr/local/ bin:/usr/ sbin:/usr/ bin:/sbin: /bin:/usr/ usr/local/ games
PATH=/usr/
games:/
$ ssh 192.168.2.91 bash -lc env|grep PATH ogra/bin: /home/ogra/ .local/ bin:/usr/ local/sbin: /usr/local/ bi sbin:/usr/ bin:/sbin: /bin:/usr/ games:/ usr/local/ games:/ snap/bin
PATH=/home/
n:/usr/
you could also do something like:
ssh 192.168.2.91 "source /etc/profile; hello"
i dont think we have a bug open for this and technically it is expected
behaviour (not different from any other ubuntu install), but given how
annoying it is i guess you should file one and we should find a proper
workaround or fix to ship in the image ...