network: version: 2 wifis: wlo1: dhcp4: true access-points: "<ssid>": auth: key-management: "psk" password: <password>
network: version: 2 wifis: wlo1: dhcp4: true access-points: "<ssid>": auth: key-management: "psk" password: <password>
network: version: 2 wifis: wlo1: dhcp4: true access-points: "<ssid>": auth: key-management: "psk" password: <password>
sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade
sudo apt install openssh-server
sudo apt install openssh-server
sudo apt install openssh-server
sudo systemctl enable --now ssh
sudo systemctl enable --now ssh
sudo systemctl enable --now ssh
sudo ufw enable && sudo ufw allow <custom SSH port> && sudo ufw status
sudo ufw enable && sudo ufw allow <custom SSH port> && sudo ufw status
sudo ufw enable && sudo ufw allow <custom SSH port> && sudo ufw status
systemctl daemon-reload
systemctl restart ssh.socket
systemctl daemon-reload
systemctl restart ssh.socket
systemctl daemon-reload
systemctl restart ssh.socket
ssh -p <custom port> username@server-ip
ssh -p <custom port> username@server-ip
ssh -p <custom port> username@server-ip - version: 2: This specifies the version of the configuration format. Version 2 is the most recent and is used for newer Netplan versions (from Ubuntu 17.10 and later).
- dhcp4: true: This tells the system to use DHCP (Dynamic Host Configuration Protocol) to automatically obtain an IPv4 address from the router or network. Essentially, the system will request an IP address from the router when it connects to the Wi-Fi network.
- key-management: "psk": This specifies the type of authentication to use. "psk" stands for Pre-Shared Key, which is the most common form of Wi-Fi authentication (the password you use to connect to the network). - Update system and the packages: - Install OpenSSH: - Start and enable SSH service: - Port: Changed from the default port 22 to a custom port for enhanced security.
- PubkeyAuthentication: Set to yes to enable more secure authentication using SSH keys.
- PasswordAuthentication: Set to no to disable password-based authentication, allowing only pubkey authentication.
- PermitRootLogin: Set to no to prevent logging in directly as the root user.
- PermitEmptyPasswords: Set to no to prevent users from logging in with empty passwords.
- MaxAuthTries: Set to 6 to limit the number of unsuccessful authentication attempts within a single session.
- MaxSessions: Set to 10 to limit the number of concurrent sessions per user.
- AllowUsers and AllowGroups: Specifies the users and groups allowed to access the server.
- LoginGraceTime: Set to 30s to allow a 30-second window for successful authentication before disconnecting.
- ClientAliveCountMax: Set to 3 to limit the number of missed keep-alive messages before disconnecting the client.
- ClientAliveInterval: Set to 300 seconds (5 minutes) to define the inactivity timeout after which the user is disconnected.