0

I have the following ~/.ssh/config file :

Host myserver1
    Hostname myserver1.blop.com
    User blup

Host myserver2
    Hostname myserver2.blop.com
    User blup

Host bitbucket.org
    RemoteCommand # Want to not take care of global RemoteCommand
    RequestTTY no

Host *
    User root
    RemoteCommand PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"' $SHELL;
    RequestTTY yes

I want a default RemoteCommand on all server that change PROMPT_COMMAND on remote shell after login. (this is working) The RemoteCommand option make connections to bitbucket (git) fail and I didn't find a way to disable RemoteCommand for a specific host.

Tried : Nothing, Empty string "", $SHELL;

Any idea ? There is a default RemoteCommand value to restore ?

0

1 Answer 1

2
  1. Use none as RemoteCommand value.
Host bitbucket.org
    RemoteCommand none
    RequestTTY no
  1. An Alternative approach is to simply exclude bitbucket.org from default Host config :
Host * !bitbucket.org
    User root
    RemoteCommand PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"' $SHELL;
    RequestTTY yes
  1. Better solution, for my specific problem with RemoteCommand, add a Match to only apply settings for ssh commands:

Simply add this at top of file

Match exec "test $_ = /usr/bin/ssh"
    RemoteCommand PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"' $SHELL;
    RequestTTY yes

You must log in to answer this question.

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