To avoid specifying the full path of a command whenever it is prepared
for ssh execution, is there a quick and dirty way to set the PATH
variable on the fly for ssh to locate and run the command?
Have tried with ~user/.ssh/rc and ~user/.ssh/environment but to no
avail.
Meanwhile, ssh user@host ". .profile; modinfo" looks a bit unwieldy to
me.
Thanks.
the default PATH is specified at build time, you might do
ssh user@host 'echo $PATH'
and see what you've got to work with. Also see the man page for
sshd_config. You might want to look at PermitUserEnvironment.
If set, it allows sshd to use the "environment" file in the ~/.ssh/
environment to set variables, including PATH. There are adverse
security implications noted