Jeff Saremi
Jeff Saremi

Reputation: 3024

Mobaxterm: how to prevent ssh session from exiting?

How do i stop this?

Session stopped
    - Press <return> to exit tab
    - Press R to restart session
    - Press S to save terminal output to file

Network error: Software caused connection abort

It looks SSH keepalive setting has no effect there

Upvotes: 62

Views: 137926

Answers (7)

Muhammed Fasil
Muhammed Fasil

Reputation: 8576

Settings -> Configurations and refer the image below

enter image description here

Upvotes: 2

Amit P
Amit P

Reputation: 1

  1. Open Mobaxterm.
  2. Go to Tools.
  3. Click MobaKeyGen (SSH Key Generator) option.
  4. Load the .pem file downloaded while creating EC2 AWS instance.
  5. Increase "Number of bits in a generated key" Ex. 4090.
  6. Also select "Session Keep Alive" option in "SSH" tab while creating Mobaxterm session.

Upvotes: 0

Juan Manuel Rivera
Juan Manuel Rivera

Reputation: 109

As an altenrative, if you need some code to keep running even if you get disconnected (for example, large SQL querys) you can use tmux to create a session that executes in the background. If you get disconected you can simply attatch back to the session where you were executing the code.

In case someone need it you can find a tmux cheatsheet here

Upvotes: 0

Kotresha MC
Kotresha MC

Reputation: 1

Change the Settings -> Configuration -> SSH -> SSH Engine to Legacy it will work enter image description here

Upvotes: 0

helloworld
helloworld

Reputation: 1564

If you are still looking for the answer like me, here you go!

Settings -> Configuration -> SSH -> SSH keepalive

Restart MobaXTerm after changing the setting for it to take effect.

https://superuser.com/a/1298536

Upvotes: 143

pastorchris
pastorchris

Reputation: 73

Both solutions posted above (by @helloworld & @jepachecoh) actually work but there may be need for extra work, so here are a few additions.

The two options above work if:

1. You're connecting to a host (destination server) that is running SSH (daemon) but doesn't have any session timeout configurations set for connecting SSH clients.

2. You're connecting to a host that already has SSH client timeout configuration set but the set value (on the remote host) is either higher than, or equal to the "keepalive" value you have set on your SSH client (like MobaXterm, Putty etc).

If the destination server's "SSH keepalive configurations for the clients" are set, they override your remote client SSH keepalive configurations, hence controlling the session timeouts.

To find out if there are any configs set on the destination server's SSH configurations, use the command below (as root, or a user with sudo privileges):

$ cat /etc/ssh/sshd_config | grep "ClientAlive"

The command above works on multiple Linux and Solaris flavours. If you don't have admin access to the destination server, your Systems administrator may be managing your session timeouts irrespective of the "keepalive" parameters you set on your SSH client before connecting.

Lastly, if you are using VPN software, or connecting to a demilitarized zone (DMZ), sometimes the session timeouts are controlled at that level (firewall level), so involve your Network administrator.

Bottom line, love your administrators. :-)

Upvotes: 7

jepachecoh
jepachecoh

Reputation: 136

In my case I have SSH keepalive option checked but this happens every now and then.

So what I do is.

  • Disable (uncheck) SSH keeaplive close MobaXterm
  • Open MobaXterm and check SSH keeaplive close MobaXterm (again)
  • Open MobaXterm enjoy the stability for a couple of weeks...

I am using a licensed version on a computer running Windows 10 Professinal version 20H2.

Upvotes: 8

Related Questions