JuanPablo
JuanPablo

Reputation: 24774

time of disconnection in ubuntu server

in ubuntu server (with ssh protocol),
how I can change the time of disconnection for inactivity?

Upvotes: 1

Views: 577

Answers (2)

johnpaulhayes
johnpaulhayes

Reputation: 563

For others internet travellers who may see this question.

The simplest solution to this is to put the following line in your ~/.ssh/config file (create the file if it doesn't exist)

host *
    ServerAliveInterval 30

Upvotes: 1

Pavan
Pavan

Reputation: 18528

Could you put "exec screen -R" in .bash_profile and "idle 900 lockscreen" in .screenrc to solve this? That'd automatically reattach to their screen session if it's still there and create a new one if it isn't, but lock the screen if it's idle for 900 seconds.

I believe users could disable the idle, though...

Alternately: just plain "exec screen" and also "autodetach off" in .screenrc so that their sessions die if they get disconnected.

http://www.openg.info/entry/timeout-ssh-sessions-inactivity

Or you can use

ClientAliveInterval 600 ClientAliveCountMax 0 and it works

or

using export TMOUT=3600 in my ~/.bashrc to close an inactive session after 1 hour.

Both have been reported to work by the user in: http://www.openg.info/entry/ssh-session-inactivity-configuration

Hope this helps

PK

Upvotes: 1

Related Questions