Need help testing SSH command

  • Ab sofort steht euch hier im Forum die neue Add-on Verwaltung zur Verfügung – eine zentrale Plattform für alles rund um Erweiterungen und Add-ons für den DSM.

    Damit haben wir einen Ort, an dem Lösungen von Nutzern mit der Community geteilt werden können. Über die Team Funktion können Projekte auch gemeinsam gepflegt werden.

    Was die Add-on Verwaltung kann und wie es funktioniert findet Ihr hier

    Hier geht es zu den Add-ons

DaveR

Benutzer
Sehr erfahren
Add-on Developer
Registriert
30. März 2022
Beiträge
1.145
Reaktionspunkte
2.069
Punkte
229
For some users of my https://github.com/007revad/ContainerManager_for_all_armv8 script it sometimes fails to install Container Manager. So the script says:
Code:
Do NOT exit the script or close this window.
Please do a manual install:
1. Download the latest ContainerManager-${Cyan}armv8${Off} spk file from:
   https://archive.synology.com/download/Package/ContainerManager
2. Open Package Center.
3. Click on the Manual Install button.
4. Click on the Browse button.
5. Browse to where you saved the ContainerManager spk file.
6. Select the spk file and click Open.
7. Click Next and install Container Manager.
8. Close Package Center.
9. Return to this window so the script can restore the correct model number.
10. Type yes after you have manually installed Container Manager.

and then waits for them to type yes.

But for a couple of users they took too long and the SSH connection got terminated. So instead of read -r answer I thought of changing it to:
(while true; do sleep 20; echo -ne "\0"; done) & read -r answer; kill $! but I have no way to test it because my SSH connection never times out.

Can people test if their SSH connection times out and how long it took:
read -r answer

And if it did get disconnected then test if this prevents it getting disconnected:
(while true; do sleep 20; echo -ne "\0"; done) & read -r answer; kill $!
 
  • Like
Reaktionen: ctrlaltdelete
On my side it never times out until the network connection will be closed, due to energy saving mode or closing the laptop.
 
I would say it is not your fault that the ssh connection will be closed. This depends on the server configuration and by default the session will be closed after a timeout. This could also achieved with configuring those attributes on the servers sshd config but it is not recommended. It is better to use your client config from where the connection is initiated.

I personally would recommend to configure your ~/.ssh/config file on the client not on the remote server.

For example you can use this for every server that will be connected
Code:
Host *
  ServerAliveInterval 60
  ServerAliveCountMax 10

Or just for the specific one you want to
Code:
Host myHost
  HostName my.server.tld
  Port 22
  ServerAliveInterval 60
  ServerAliveCountMax 10

This will generally keeps the ssh session alive.
 
Zuletzt bearbeitet:

Additional post fields

 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat