jportela: (Default)
jportela ([personal profile] jportela) wrote in [site community profile] dw_dev_training2010-04-04 08:22 pm
Entry tags:

Keeping your ssh connection with dreamhack alive

When I connected to my dreamhack account via ssh (in ubuntu terminal), sometimes the terminal froze after some minutes of innactivity. I discovered this solution (works in ubuntu but probably works in any linux distribution with openssh. Windows users have putty, which may or may not have the same problem, but different configuration anyway).

You should only try this command in your *nix based computer (*not* on the ssh connection to the dreamhack account, as it won't work):

echo -e "ServerAliveInterval 15\nServerAliveCountMax 3" >> ~/.ssh/config 
 
If you are likely to use different machines to access your dreamhack account, then you can set it on the dreamhack server as this:

echo -e "KeepAlive yes\nClientAliveInterval 60" >> ~/.ssh/config 

And in Putty you have to change the parameter:

Seconds between keepalives, in the Connection Setup tab, to 15

For credits on the solutions, just browse the replies below :)

exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2010-04-04 07:36 pm (UTC)(link)
You shouldn't even need to do "cp /etc/ssh/ssh_config ~/.ssh/config" -- ~/.ssh/config should add *to* the global file anyway
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2010-04-04 10:24 pm (UTC)(link)
I should note for anybody wanting to try this - this assumes that the computer you're connecting *from* (ie. your computer) is Linux-based; you shouldn't do it on the Dreamhack maching itself as it won't work.
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2010-04-05 01:01 am (UTC)(link)
s/Linux/*nix/ :-)
hypatia: (Default)

[personal profile] hypatia 2010-04-05 06:53 am (UTC)(link)
if you want to set it on the server side:

add the following to the /etc/ssh/sshd_config file on your server:

KeepAlive yes
ClientAliveInterval 60

works great if you're likely to ssh in from different machines.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-04-05 01:08 am (UTC)(link)
I use this as well (I thought I was the only one who needed it because of a bad connection!) -- it works like a charm :)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2010-04-05 01:11 am (UTC)(link)
For PuTTY, the parameter to set is: Seconds between keepalives (in the Connection setup tab)