This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| deb9:ssh [2021/07/21 00:34] – [Linux Host] Bernard Condrau | deb9:ssh [2025/11/08 14:09] (current) – [Settings] Bernard Condrau | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== SSH Client and Server ====== | ====== SSH Client and Server ====== | ||
| To login to any machine with SSH, you need to install the ssh server. The client is installed on Debian by default. Terminology used is " | To login to any machine with SSH, you need to install the ssh server. The client is installed on Debian by default. Terminology used is " | ||
| + | |||
| + | <color red>Need to update: Iapetus, Pandora</ | ||
| ===== Linux Server ===== | ===== Linux Server ===== | ||
| Line 7: | Line 9: | ||
| * Do the same for Windows Subsystem for Linux on Windows 10 | * Do the same for Windows Subsystem for Linux on Windows 10 | ||
| ==== Settings ==== | ==== Settings ==== | ||
| - | * Modify /etc/ssh/sshd_conf:< | + | * Modify /etc/ssh/sshd_config:< |
| LoginGraceTime 20 | LoginGraceTime 20 | ||
| AuthorizedKeysFile .ssh/ | AuthorizedKeysFile .ssh/ | ||
| PasswordAuthentication no | PasswordAuthentication no | ||
| PermitEmptyPasswords no | PermitEmptyPasswords no | ||
| - | PermitRootLogin | + | PermitRootLogin |
| * If you want to allow ssh root access from a regular user on the same host, or from another host (e.g. BackupPC), add the following lines to the end of sshd_config:< | * If you want to allow ssh root access from a regular user on the same host, or from another host (e.g. BackupPC), add the following lines to the end of sshd_config:< | ||
| PermitRootLogin without-password</ | PermitRootLogin without-password</ | ||
| Line 20: | Line 22: | ||
| PrintLastLog yes | PrintLastLog yes | ||
| TCPKeepAlive yes</ | TCPKeepAlive yes</ | ||
| - | * Restart the SSH server:< | + | * Restart the SSH server:< |
| ===== Linux Host ===== | ===== Linux Host ===== | ||
| Line 43: | Line 45: | ||
| * **Save public key** and **Save private key** | * **Save public key** and **Save private key** | ||
| + | ===== Access through Relais Hosts ===== | ||
| + | I have machines in a location without fixed IP address, and where external access is only possible through a relais host. | ||
| + | * Avoid SSH disconnects after inacitivity by adding the following to '' | ||
| + | ClientAliveCountMax 2</ | ||
| + | * Alternatively, | ||
| + | ServerAliveInterval 300 | ||
| + | ServerAliveCountMax 2</ | ||
| + | * I have restricted SSH access to machines with known IP addresses, so find from where (relais machine) you connect through SSH< | ||
| + | * Add or modify the restriction to your '' | ||
| + | * See [[deb10: | ||
| + | ==== Links ==== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[http:// | ||
| + | ===== Copy file from remote host ===== | ||
| + | * '' | ||
| + | * [[https:// | ||
| ===== X Client ===== | ===== X Client ===== | ||
| ==== Debian ==== | ==== Debian ==== | ||