Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I access a Beowulf cluster which only allows local connections when I am at work. To work on the cluster from home, I login to an onsite ssh server then run a simple ssh script, to login to the cluster. What i want to do is have 1 script I can run at home to link my up to the on site ssh server, then onto the cluster. My ssh sever that accesses the cluster is Ubuntu 13.04, and my home client computer is Ubuntu 12.04

how can i tell ssh to execute a script once it logs in?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

ssh allows by default executing commands, e.g.

ssh <host> <command>

or

ssh <host> '<command1>; <command2>'

In your case, you will probably need to specify -t to force tty allocation on the middle-server. So try something like:

ssh -t <your gateway> '<script call>'
share|improve this answer
    
Ah beautiful! This works. Thank you so much! –  j0h Jan 4 at 22:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.