Tag Archive for 'SSH'

.ssh config for Windows and Linux

The ~/.ssh/config file works for OpenSSH on Windows and for SSH on Linux.

To prevent disconnects, add the keepalive messages for all hosts. For specific hosts that use a specific key type, such as RSA on CentOS 6, add the specific algorithm via the HostkeyAlgorithms + functionality. To add a private key for SSH key logins, add the IdentityFile line. it is possible to allow the ssh-rsa algorithms on both outgoing and incoming connections for all hosts. The PubkeyAcceptedAlgorithms functionality is which key can be used to log into the host the config file sits on. the ForwardX11 setting sits on Linux hosts and not on Windows..

example ~/.ssh/config

IdentityFile ~/.ssh/Minecraft-Micro.pem

Host *
    ServerAliveInterval 40

Host 192.168.0.0
    HostkeyAlgorithms +ssh-rsa
 
ForwardX11 yes
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

Debian 12 PATH and X11

A few quirks with Debain 12 include that path not being set in similar fashion to Fedora, Ubuntu, and other distributions.  One must regularly set

export PATH=$PATH:/usr/sbin

In Gnome, applications will open on the server instead of the client when using X11 forwarding.  This will occur even though xcalc opens on the client normally.  The way to avoid this is to add the following to .bashrc

unset XDG_RUNTIME_DIR 
unset GDK_BACKEND

The general rule is compress, then encrypt.1, 2

1. https://stackoverflow.com/questions/4676095/when-compressing-and-encrypting-should-i-compress-first-or-encrypt-first

2. https://crypto.stackexchange.com/questions/33737/is-it-better-to-encrypt-before-compression-or-vice-versa