0

When I SSH into my gear on OpenShift the default SSH timeout is 300 seconds, which I find too short. I can run either of the following commands in the terminal to fix this:

export TMOUT=30000
unset TMOUT

However, doing this on each login is a chore and I sometimes forget. I don't appear to be able to edit .bashrc, and putting these commands in $OPENSHIFT_DATA_DIR/.bash_profile doesn't work either.

I have resorted to echoing a reminder message from my .bash_profile and appending export TMOUT=30000 to my bash history with history -s "export TMOUT=30000". This, at least, makes it easier to run the command while also giving me a reminder.

But ideally this would happen automatically. Is there any way to achieve this?

Ninjakannon
  • 101
  • 3

1 Answers1

0

You can write a bash script to prompt you for name and ip and run:

ssh -t name@ip 'export TMOUT=30000; bash -l'

Then, if you don't already have one, create a .bash_logout file to run "unset TMOUT"

I think this should work and make your life easier :)

Sam Perry
  • 41
  • 5