How to - automatically log out of SSH
-
Having a secure connection to your VPS is important but so is remembering to close it.
Here's how to have the system automaticallly log you out
Open the sshd_config file
sudo nano /etc/ssh/sshd_config
Scroll to the bottom of the page and add the following two lines
ClientAliveInterval 300
ClientAliveCountMax 0The Client Alive Count is in seconds so 300 = 5 minutes
Hit Ctrl+O, then Enter, then Ctrl+X
Now, restart sshd so the new instructions can be read
sudo /etc/init.d/ssh restart
Done!
Posted 1 year ago # -
you know, this is a pretty important security tip.
figure I'd best start some kind of a tips tag, just for you Barnaby.
thank you, will work all this lot into the tuts and scripts .. keep 'em coming m8 :)
Posted 1 year ago # -
There is a potential problem with this method however. It doesn't run the exit alias, I mentioned in another post, to ensure Wordpress is safe.
Maybe some kind of script could be run upon login which would set an inactivity countdown.
When the session reaches X number of seconds of inactivity, the exit command, or whatever else you choose, could be run.
There's probably a much simpler way of doing this!
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
