0

I have a remote (Debian 8) machine that I log into via SSH. In my every ssh session I need to initialize a variable "XDEBUG_CONFIG" so that later I can use debugging tools during the same session.

This is what I have to type in every one of my sessions:

export XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=10.0.2.2 remote_connect_back=0"

This variable is then used by other programs that I start within the same session.

I want to type less (or avoid typing at all, so that the variable XDEBUG_CONFIG is set automatically when I log in). The value is the same every time.

I tried putting the command into ~/.ssh/rc but it doesn't help. When I login again and

echo $XDEBUG_CONFIG

it shows an empty line. So far I have created and alias in my ~/.bashrc like this

alias helpdebug='echo "export XDEBUG_CONFIG=\"remote_enable=1 remote_mode=req remote_port=9000 remote_host=10.0.2.2 remote_connect_back=0\""'

and tried running this in backticks:

`helpdebug`

but this results in variable "XDEBUG_CONFIG" set to "remote_enable=1" only (i.e. up to the first space).

1
  • 1
    If it's fixed and not generated somehow, put it into ~/.bashrc Sep 30, 2017 at 7:42

1 Answer 1

2

Put this in your ~/.bashrc:

if [ -n "$SSH_CONNECTION" ]; then
    export XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=10.0.2.2 remote_connect_back=0"
fi
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .