Difference between revisions of "SSH"

From Cncz
Jump to: navigation, search
Line 43: Line 43:
  
 
=== [en]SSH tips and settings[/en][nl]SSH Instellingen en tips[/nl] ===
 
=== [en]SSH tips and settings[/en][nl]SSH Instellingen en tips[/nl] ===
 +
 +
[nl]
 +
Om waarschuwingen over mogelijk veranderde ssh keys of 'unknown host' als je een ssh verbinding met een host
 +
in het science.ru.nl domein maakt hebben we de publieke sleutel van al onze servers getekend.
 +
Als je de volgende regels toevoegt aan het bestand 'config' in de .ssh directory in je (lokale) home directory
 +
(het kan zijn dat dit file nog niet bestaat)
 +
[/nl]
 
[en]
 
[en]
 
+
To avoid warnings about possibly changed ssh keys or 'unkown host' the first time you connect to a  
To avoid warnings about possibly changed ssh keys or unkown host the first time you connect to a  
 
 
host in the science.ru.nl domain we have signed the public keys of all our  servers.  
 
host in the science.ru.nl domain we have signed the public keys of all our  servers.  
 
If you add the following lines to the file 'config' in the .ssh directory in your (local) home directory
 
If you add the following lines to the file 'config' in the .ssh directory in your (local) home directory
 
(the file may not exist yet)
 
(the file may not exist yet)
 +
[/en]
 
   CanonicalDomains science.ru.nl
 
   CanonicalDomains science.ru.nl
 
   CanonicalizeFallbackLocal no
 
   CanonicalizeFallbackLocal no
 
   CanonicalizeHostname yes
 
   CanonicalizeHostname yes
  
 +
[nl]
 +
en de volgende regel aan .ssh/known_hosts
 +
[/nl]
 +
[en]
 
and the following line to .ssh/known_hosts
 
and the following line to .ssh/known_hosts
 +
[/en]
 
   @cert-authority *.science.ru.nl ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHpJveyOrLKFRDsbiW/29OadbCbkmUaIXnWbhVwtytbpftAc7Stj2RYa8yBmgfdm82T/UBVu1tLbeeCYQI8UlCvbAALMx+I60ux+iEGVdDBgIOjeu6LuY12pksVlXy/nKc59+m3AdMXfGHA8cI/O8eFosQLJ+dck7SBcvTT4lPhEcSQxg==
 
   @cert-authority *.science.ru.nl ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHpJveyOrLKFRDsbiW/29OadbCbkmUaIXnWbhVwtytbpftAc7Stj2RYa8yBmgfdm82T/UBVu1tLbeeCYQI8UlCvbAALMx+I60ux+iEGVdDBgIOjeu6LuY12pksVlXy/nKc59+m3AdMXfGHA8cI/O8eFosQLJ+dck7SBcvTT4lPhEcSQxg==
  
ssh keys of science.ru.nl hosts will be automatically accepted. The change to the 'config' file ensures that  
+
then ssh keys of science.ru.nl hosts will be automatically accepted. The change to the 'config' file ensures that  
 
   ssh lilo5
 
   ssh lilo5
 
will match with lilo5.science.ru.nl and the line in known_hosts ensures that only for hostnames matching with *.science.ru.nl  
 
will match with lilo5.science.ru.nl and the line in known_hosts ensures that only for hostnames matching with *.science.ru.nl  

Revision as of 16:29, 8 March 2021

SSH Secure Shell

SSH is used to get a secure terminal-connection to a login server. All Linux loginservers can be reached with SSH client software, not only on the standard port 22, but also on ports 80 and 443.


Recommended ssh client software

  • Windows:
    • MobaXterm. From the MobaXterm website: "MobaXterm is an enhanced terminal for Windows with an X11 server, a tabbed SSH client and several other network tools for remote computing (VNC, RDP, telnet, rlogin). MobaXterm brings all the essential Unix commands to Windows desktop, in a single portable exe file which works out of the box." The support of OpenGL could also be a reason to start using MobaXterm. If you use it professionally, you should consider subscribing to MobaXterm Professional Edition. MobaXterm is available on the S-disc.
    • Mosh (mobile Shell) when roaming and intermittent connections.
    • PuTTY.
    • The OpenSSH client provided by Cygwin.
  • Linux: Your computer should have ssh installed by default. Otherwise, install the openssh-client package. Install Mosh (mobile Shell) when roaming or having intermittent connections.
  • OS X: the ssh client should be available on your Mac. For graphical/X11 functionality one can install XQuartz. Install Mosh (mobile Shell) when roaming or having intermittent connections.
  • Android: JuiceSSH or ConnectBot. Install Mosh (mobile Shell) when roaming or having intermittent connections.

Recommended file transfer clients


SSH tips and settings

To avoid warnings about possibly changed ssh keys or 'unkown host' the first time you connect to a host in the science.ru.nl domain we have signed the public keys of all our servers. If you add the following lines to the file 'config' in the .ssh directory in your (local) home directory (the file may not exist yet)

  CanonicalDomains science.ru.nl
  CanonicalizeFallbackLocal no
  CanonicalizeHostname yes

and the following line to .ssh/known_hosts

  @cert-authority *.science.ru.nl ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHpJveyOrLKFRDsbiW/29OadbCbkmUaIXnWbhVwtytbpftAc7Stj2RYa8yBmgfdm82T/UBVu1tLbeeCYQI8UlCvbAALMx+I60ux+iEGVdDBgIOjeu6LuY12pksVlXy/nKc59+m3AdMXfGHA8cI/O8eFosQLJ+dck7SBcvTT4lPhEcSQxg==

then ssh keys of science.ru.nl hosts will be automatically accepted. The change to the 'config' file ensures that

  ssh lilo5

will match with lilo5.science.ru.nl and the line in known_hosts ensures that only for hostnames matching with *.science.ru.nl ssh will check if the public key of the host is signed by us and if that is indeed the case will accept the host key. If you do not want to change the config file then you will always have to use the fully qualified name lilo5.science.ru.nl.



Ssh can be used for:

  • port forwarding on another host
  • proxying for example web traffic
  • almost complete vpn functionality

Please consult this article for some excellent tips on how to use and configure your ssh client. [/en]

Preventing disconnects

In case you experience connectivity issues using ssh, use the following settings for your ssh-client. This can be done by adding the following lines to the config file .ssh/config (or /etc/ssh/ssh_config):

TCPKeepAlive no
ServerAliveInterval 60
ServerAliveCountMax 10