I'm using a product called vlad which is making non-interactive ssh connections to my Ubuntu server but the problem is that it can't see any of the environment variables.
I've been googling like crazy but can't find a solution. I've tried adding the variables to an .ssh/environment file for the user on my server and also changing the settings in /etc/ssh/sshd_config but no joy.
Can anyone help?
Cheers,
Chris
Check you /etc/ssh/ssh_config (on client) and look at SendEnv option. In my case, I have
SendEnv LANG LC_*
.There is some interresting informtions in the man ssh_config
If you have control of the ssh command call itself, you can try something like this:
I also use "tee" (for visual clarity) and heredoc to send remote bash scripts:
What is the shell of that user on the server? If it's bash, then ~/.bash_profile or ~/.profile containing all the variables (or something like ". /etc/environment") should work. If it's not bash, consider changing :)
my guess is your environment variables are in the wrong file. there are two different files which get sourced for login/interactive shells.
take a look at this post:
What is the difference between a 'Login' and an 'Interactive' bash shell
EDIT: ok, now for non-interactive logins:
are you login in with a key? when yes, you can add this to your
authorized_keys
file:(from man sshd)
Do you have the environmental variables defined in
~/.bashrc
on the server? Sometimes somethings read~/.profile
instead. One trick I do is to symlink~/.profile
to~/.bashrc
,e.g.:
@Dom (I can't post comment): for me it's working
/etc/ssh/sshd_config