i have a ssh jumphost. On the sshjumphost i wanna execute
always a python script if user want use my jumphost to jump.

client1 -------- jumphost ---------targethost

Client use following command:

ssh -o ProxyCommand="ssh -W %h:%p test\\\\[email protected]" user@targethost

I used the server sshd_config and set

ForceCommand scriptname

But my script dont triggered if a client use the command above.

But if i use following command:

ssh [email protected]  

then my script was triggered.

What can i do to trigger always a script if a user wanna use my jumphost?

Best regards mobios


1 Answer 1


If you want to run a script on user level the you may need to put that script/command in the /home//.bashrc for BASH shell, put to the right file according to the users login SHELL.


[RHuser@LinuxServer ~]$ cat .bashrc

Source global definitions

if [ -f /etc/bashrc ]; then . /etc/bashrc fi

User specific aliases and functions

uname -a;uptime

[RHuser@LinuxServer ~]$


[RHuser@Jumpboxserver ~]$ ssh LinuxServer RHuser@LinuxServer's password: Authentication successful. 20:22:16 up 4 days, 8:22, 1 user, load average: 0.00, 0.00, 0.00 [RHuser@LinuxServer ~]$

You must log in to answer this question.

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