Is there a way to keep Termux ssh connection with remote host alive with screen off on Android?

Follow

@nikolal I believe you can give termux permission to run in the background, do not battery optimize it and leave the session open. Your remote machine probably has a default timeout for security reasons, if it does you have to turn it off, but i would not recommend it unless you are using key based auth

@mister_monster
I am using key based auth, but I think it may be harder to do that because of android 9 background app sistem. I've enabled other apps to ignore battery optimisation and they still fail to do their tasks as intended. For example I'm using Nextcloud to sync my contacts, calendar etc and it fails to do scheduled task even with battery optimisation off. Thanks for advice anyway

@nikolal That is probably caused by your device itself lowering power by turning off networking when the screen is off. I am not sure where to change that in Android 9 but you can turn it off so that wifi stays active even when the device is idle.

Sign in to participate in the conversation
Mastodon 🔐 privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!