{"id":2953,"date":"2026-06-11T23:10:33","date_gmt":"2026-06-11T23:10:33","guid":{"rendered":"https:\/\/sreschool.com\/blog\/?p=2953"},"modified":"2026-06-11T23:10:33","modified_gmt":"2026-06-11T23:10:33","slug":"how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos","status":"publish","type":"post","link":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/","title":{"rendered":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using <strong>Royal TSX on macOS<\/strong> and your <strong>SSH session disconnects after a few minutes of idle time<\/strong>, the problem is usually not your username, password, SSH key, or server login.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Most of the time, the session is being disconnected because the SSH connection becomes idle and some network device, firewall, VPN, router, NAT gateway, or server policy closes the inactive TCP connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is a very common issue when working with Linux servers from macOS using Royal TSX.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Symptoms<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You may see issues like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSH session disconnects after 3\u201310 minutes of no typing<\/li>\n\n\n\n<li>Royal TSX terminal becomes frozen<\/li>\n\n\n\n<li>You come back after a short break and the session is gone<\/li>\n\n\n\n<li>Long-running commands stop if they were not running inside <code>tmux<\/code> or <code>screen<\/code><\/li>\n\n\n\n<li>Normal terminal SSH may behave differently from Royal TSX<\/li>\n\n\n\n<li>The issue happens mostly when idle, not while actively typing<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Why This Happens<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH is a long-running network connection. When no data is sent for some time, firewalls, VPNs, routers, NAT gateways, cloud security devices, or server-side timeout policies may think the connection is inactive and close it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To prevent this, the SSH client should send small keep-alive packets at regular intervals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Royal TSX, you should configure keep-alive inside the Royal TSX SSH connection settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For macOS OpenSSH, you can also configure keep-alive inside:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Both settings are useful because Royal TSX may not always depend fully on your macOS OpenSSH config, depending on the terminal plugin being used.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 1: Enable SSH Keep Alive in Royal TSX<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Open your saved SSH connection in Royal TSX.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Royal TSX \u2192 SSH Connection \u2192 Properties \/ Edit\n\u2192 Advanced\n\u2192 Session\n\u2192 SSH Keep Alive Interval\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set the value to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>30\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>60\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Recommended value:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>30\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This means Royal TSX sends a keep-alive packet every 30 seconds to keep the SSH session active.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the value is set to <code>0<\/code>, keep-alive may be disabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recommended Royal TSX Setting<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>SSH Keep Alive Interval = 30 seconds\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is usually the most effective fix.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 2: Configure macOS SSH Client Keep Alive<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Now configure your macOS SSH client globally.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open Terminal on your Mac and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p ~\/.ssh\nnano ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Host *\n    ServerAliveInterval 60\n    ServerAliveCountMax 3\n    TCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In nano:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CTRL + O \u2192 Enter \u2192 CTRL + X\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then fix file permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 700 ~\/.ssh\nchmod 600 ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What These Settings Mean<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code>ServerAliveInterval 60<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This tells your SSH client to send a keep-alive message every 60 seconds if no data is received from the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>ServerAliveCountMax 3<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This tells SSH to allow 3 missed keep-alive responses before disconnecting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So with this setting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>60 seconds \u00d7 3 = around 180 seconds\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the server becomes unreachable for around 3 minutes, SSH disconnects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>TCPKeepAlive yes<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This enables TCP-level keepalive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, <code>ServerAliveInterval<\/code> is usually more useful for SSH idle disconnect problems because it works at the SSH protocol level.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 3: Best Practice SSH Config Layout<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If you already have GitHub or other SSH host entries, keep your specific hosts first and put <code>Host *<\/code> at the bottom.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Recommended structure:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Default GitHub account\nHost github.com\n    HostName github.com\n    User git\n    IdentityFile ~\/.ssh\/id_ed25519\n    IdentitiesOnly yes\n    AddKeysToAgent yes\n    UseKeychain yes\n\n# DevOps \/ Cotocus GitHub account\nHost devops\n    HostName github.com\n    User git\n    IdentityFile ~\/.ssh\/cotocusin\n    IdentitiesOnly yes\n    AddKeysToAgent yes\n    UseKeychain yes\n\n# Global default settings for all SSH connections\nHost *\n    ServerAliveInterval 60\n    ServerAliveCountMax 3\n    TCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Why put <code>Host *<\/code> at the bottom?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because <code>Host *<\/code> applies to all SSH hosts. Keeping specific host entries first and general defaults at the end is cleaner and avoids unexpected behavior.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 4: Verify macOS SSH Config Is Working<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command from your Mac:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -G your-server-ip-or-hostname | grep -Ei \"serveralive|tcpkeepalive\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -G 192.168.1.10 | grep -Ei \"serveralive|tcpkeepalive\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>serveraliveinterval 60\nserveralivecountmax 3\ntcpkeepalive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you see this output, your macOS SSH client config is active.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Important note: this confirms normal OpenSSH behavior from macOS Terminal. Royal TSX may still need its own keep-alive setting enabled separately.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 5: Check If You Edited the Wrong SSH Config<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Many users check this file on macOS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/ssh\/sshd_config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">But this file is for the SSH server running on your Mac.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That means it controls incoming SSH connections to your Mac, not outgoing SSH sessions from your Mac to another Linux server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For your Royal TSX outgoing SSH issue, the important client-side file is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So this output on your Mac:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/ssh\/sshd_config:#ClientAliveInterval 0\n\/etc\/ssh\/sshd_config:#ClientAliveCountMax 3\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">does not fix Royal TSX outgoing SSH disconnects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, because the lines start with <code>#<\/code>, they are commented and not active.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 6: Check the Remote Linux Server<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If Royal TSX keep-alive and macOS SSH config do not solve the issue, check the remote Linux server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSH into the remote server and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep -Ei \"ClientAlive|TMOUT\" \/etc\/ssh\/sshd_config \/etc\/profile ~\/.bashrc ~\/.profile 2&gt;\/dev\/null\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Also check the active SSH daemon config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sshd -T | grep -Ei \"clientalive|tcpkeepalive\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Good server-side values are:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>clientaliveinterval 300\nclientalivecountmax 3\ntcpkeepalive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If needed, edit the remote server SSH daemon config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/ssh\/sshd_config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add or update:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ClientAliveInterval 300\nClientAliveCountMax 3\nTCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart SSH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Ubuntu\/Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart ssh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For RHEL\/CentOS\/AlmaLinux\/Rocky Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart sshd\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful when restarting SSH on a remote server. Keep one existing session open while testing a new login in another window.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 7: Check Shell Auto Logout Using <code>TMOUT<\/code><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes SSH is not the real problem. The Linux shell itself may be configured to log out idle users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check this on the remote server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $TMOUT\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If it returns a number like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>300\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">then the shell may auto-logout idle users after 300 seconds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Search where <code>TMOUT<\/code> is configured:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -R \"TMOUT\" \/etc\/profile \/etc\/bashrc \/etc\/profile.d\/ ~\/.bashrc ~\/.profile 2&gt;\/dev\/null\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If this is a company-managed server, do not remove it without approval because it may be part of a security policy.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 8: Prevent Command Loss Using <code>tmux<\/code><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Even after fixing keep-alive, you should use <code>tmux<\/code> for long-running work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install tmux if needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu\/Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install -y tmux\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">RHEL\/CentOS\/AlmaLinux\/Rocky Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo yum install -y tmux\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Start a tmux session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux new -s work\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run your long command inside tmux.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If SSH disconnects, reconnect and attach again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux attach -t work\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This prevents your running command from being killed when Royal TSX disconnects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Useful tmux Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux new -s work\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Detach from tmux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CTRL + B, then D\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">List sessions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux ls\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reattach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux attach -t work\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Kill session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux kill-session -t work\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Step 9: macOS Sleep Settings<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If your Mac goes to sleep, SSH will disconnect no matter how good your keep-alive settings are.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check macOS settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>System Settings \u2192 Battery \u2192 Options\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Prevent automatic sleeping when the display is off\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Also check:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>System Settings \u2192 Lock Screen\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure your Mac is not sleeping too quickly when idle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Screen lock is usually fine. Full sleep is the problem.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Recommended Final Setup<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">For most users, this setup works well:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Royal TSX<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>SSH Keep Alive Interval = 30 seconds\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">macOS <code>~\/.ssh\/config<\/code><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Host *\n    ServerAliveInterval 60\n    ServerAliveCountMax 3\n    TCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Remote Linux Server<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>ClientAliveInterval 300\nClientAliveCountMax 3\nTCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">For Long-Running Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Always use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Complete Troubleshooting Checklist<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Use this checklist if SSH still disconnects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Client Side: macOS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check SSH config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -ld ~\/.ssh\nls -l ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Fix permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 700 ~\/.ssh\nchmod 600 ~\/.ssh\/config\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify active SSH options:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -G your-server-ip-or-hostname | grep -Ei \"serveralive|tcpkeepalive\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>serveraliveinterval 60\nserveralivecountmax 3\ntcpkeepalive yes\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Royal TSX<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SSH Connection \u2192 Advanced \u2192 Session \u2192 SSH Keep Alive Interval\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Recommended:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>30 seconds\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Remote Server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Check active SSH daemon values:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sshd -T | grep -Ei \"clientalive|tcpkeepalive\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check shell timeout:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $TMOUT\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search timeout config:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -R \"TMOUT\" \/etc\/profile \/etc\/bashrc \/etc\/profile.d\/ ~\/.bashrc ~\/.profile 2&gt;\/dev\/null\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Network<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the issue still happens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check VPN timeout<\/li>\n\n\n\n<li>Check office firewall timeout<\/li>\n\n\n\n<li>Check cloud firewall or bastion timeout<\/li>\n\n\n\n<li>Check router\/NAT idle timeout<\/li>\n\n\n\n<li>Try from a different network<\/li>\n\n\n\n<li>Try direct macOS Terminal SSH and compare with Royal TSX<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Final Conclusion<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">If Royal TSX SSH sessions disconnect after a few minutes of idle time on macOS, the best fix is to enable keep-alive in Royal TSX and also configure macOS SSH keep-alive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most practical configuration is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Royal TSX SSH Keep Alive Interval = 30 seconds\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Host *\n    ServerAliveInterval 60\n    ServerAliveCountMax 3\n    TCPKeepAlive yes\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the session still disconnects, check the remote Linux server for <code>ClientAliveInterval<\/code>, <code>ClientAliveCountMax<\/code>, and shell-level <code>TMOUT<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For production work, always use <code>tmux<\/code> so your commands continue running even if the SSH client disconnects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem If you are using Royal TSX on macOS and your SSH session disconnects after a few minutes of idle time, the problem is usually not your&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2953","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School\" \/>\n<meta property=\"og:description\" content=\"Problem If you are using Royal TSX on macOS and your SSH session disconnects after a few minutes of idle time, the problem is usually not your...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/\" \/>\n<meta property=\"og:site_name\" content=\"SRE School\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-11T23:10:33+00:00\" \/>\n<meta name=\"author\" content=\"Rajesh Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajesh Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/\"},\"author\":{\"name\":\"Rajesh Kumar\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffe446f77bb2589992dbe3a7f417201\"},\"headline\":\"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS\",\"datePublished\":\"2026-06-11T23:10:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/\"},\"wordCount\":1061,\"commentCount\":0,\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/\",\"url\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/\",\"name\":\"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-06-11T23:10:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffe446f77bb2589992dbe3a7f417201\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/\",\"name\":\"SRESchool\",\"description\":\"Master SRE. Build Resilient Systems. Lead the Future of Reliability\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffe446f77bb2589992dbe3a7f417201\",\"name\":\"Rajesh Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g\",\"caption\":\"Rajesh Kumar\"},\"sameAs\":[\"http:\\\/\\\/sreschool.com\\\/blog\"],\"url\":\"https:\\\/\\\/sreschool.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School","og_description":"Problem If you are using Royal TSX on macOS and your SSH session disconnects after a few minutes of idle time, the problem is usually not your...","og_url":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/","og_site_name":"SRE School","article_published_time":"2026-06-11T23:10:33+00:00","author":"Rajesh Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rajesh Kumar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/#article","isPartOf":{"@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/"},"author":{"name":"Rajesh Kumar","@id":"https:\/\/sreschool.com\/blog\/#\/schema\/person\/0ffe446f77bb2589992dbe3a7f417201"},"headline":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS","datePublished":"2026-06-11T23:10:33+00:00","mainEntityOfPage":{"@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/"},"wordCount":1061,"commentCount":0,"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/","url":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/","name":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS - SRE School","isPartOf":{"@id":"https:\/\/sreschool.com\/blog\/#website"},"datePublished":"2026-06-11T23:10:33+00:00","author":{"@id":"https:\/\/sreschool.com\/blog\/#\/schema\/person\/0ffe446f77bb2589992dbe3a7f417201"},"breadcrumb":{"@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sreschool.com\/blog\/how-to-fix-royal-tsx-ssh-session-disconnecting-after-a-few-minutes-on-macos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sreschool.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Fix Royal TSX SSH Session Disconnecting After a Few Minutes on macOS"}]},{"@type":"WebSite","@id":"https:\/\/sreschool.com\/blog\/#website","url":"https:\/\/sreschool.com\/blog\/","name":"SRESchool","description":"Master SRE. Build Resilient Systems. Lead the Future of Reliability","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sreschool.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Person","@id":"https:\/\/sreschool.com\/blog\/#\/schema\/person\/0ffe446f77bb2589992dbe3a7f417201","name":"Rajesh Kumar","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/secure.gravatar.com\/avatar\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f901a4f2929fa034a291a8363d589791d5a3c1f6a051c22e744acb8bfc8e022a?s=96&d=mm&r=g","caption":"Rajesh Kumar"},"sameAs":["http:\/\/sreschool.com\/blog"],"url":"https:\/\/sreschool.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/posts\/2953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2953"}],"version-history":[{"count":1,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/posts\/2953\/revisions"}],"predecessor-version":[{"id":2955,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/posts\/2953\/revisions\/2955"}],"wp:attachment":[{"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sreschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}