Automatically increase OpenShift SSH timeout

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?

0
задан 11 March 2016 в 18:09
1 ответ

Вы можете написать скрипт bash для запроса имени и ip и запустить:

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

Затем, если у вас его еще нет, создайте файл .bash_logout для запуска "unset TMOUT"

Я думаю, это должно сработать и сделать вашу жизнь проще :)

.
0
ответ дан 5 December 2019 в 10:39

Теги

Похожие вопросы