Secure SHell protocol (SSH protocol)⚓︎
Allow incoming SSH conncections from local network on Ubuntu⚓︎
Warning
If connecting from macOS, make sure the terminal application is allowed to discover devices on the local network.
Install openssh-server:
Enable firewall and open port for SSH:
Modify /etc/ssh/sshd_config to listen on <PORT>:
Then, restart the service:
The daemon should be listening to <PORT>.
Copy SSH key⚓︎
With the above configuration is possible to use password autentication. Copy a SSH key, to allow passwrodless authentication.
SSH Hardening⚓︎
Ensure the following on /etc/ssh/sshd_config:
Protocol 2 # (1)!
PermitRootLogin no # (2)!
PasswordAuthentication no
AuthenticationMethods publickey
AllowUsers <USER> # (3)!
MaxSessions 2 # (4)!
- Enforce SSH protocol 2 (improved security over protocol 1)
- Disable
rootlogin, only allow non-privileged users to authenticate - Restrict access to specific users
- Limit number of concuirrent SSH sessions
Post-quantum key exchange algorithm warning⚓︎
OpenSSH on macOS (OpenSSH_10.2p1, LibreSSL 3.3.6) started showing the following warning:
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
The following options allows to silence the warning: