Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically run script/commands after connecting to OpenShift SSH

Tags:

ssh

openshift

I set up an OpenShift application and set up my local PuTTY to connect to the server via SSH. Everything works fine, but I don't know how to run a few commands (mainly alias) after I connected to the server automatically (I don't want to copy&paste the same commands everytime I connect).

On my local linux shell I can use .bashrc, but this doesn't seem to work on OpenShift. I can't write a file in my home directory (/var/lib/openshift/[some letters and numbers]/) and I don't know the right place to put this file. Does anybody know where I have to put a file which will be run everytime I login?

I'd prefer a solution which doesn't involve my local SSH software as I'm connecting to this OpenShift application from different machines.

like image 791
Reeno Avatar asked Jan 22 '26 02:01

Reeno


1 Answers

You can use your .bash_profile located in your $OPENSHIFT_DATA_DIR.

like image 103
niharvey Avatar answered Jan 25 '26 17:01

niharvey