This is an old revision of the document!
* - Enabling ssh
Enabling SSH on Ubuntu 24.04
Update Your System: Before installing any new software, it’s a good practice to update your system’s package list and upgrade the existing packages to their latest versions.
$ sudo apt update $ sudo apt upgrade
This ensures that you have all the latest security patches and software updates, reducing the risk of vulnerabilities. Install OpenSSH Server: With your system updated, the next step is to install the OpenSSH server package. This package contains the necessary software to run an SSH server.
$ sudo apt install ssh
Once installed, the SSH service will start automatically. However, it’s always a good idea to verify that the service is running properly.
Enable SSH Service to Start on Boot: To ensure that the SSH service automatically starts after a reboot, you need to enable it using systemctl.
$ sudo systemctl enable ssh
This command configures the system to start the SSH server automatically whenever the system boots up, ensuring that remote access is available after restarts without manual intervention. Verify SSH Service Status: To check the SSH service’s status and confirm that it’s active and running, use the systemctl command.
$ sudo systemctl status ssh
If the service is not running, you can start it with the command:
$ sudo systemctl start ssh
This step ensures that the SSH server is operational and ready to accept connections. Configure Firewall: If you are using the UFW firewall, it’s necessary to configure it to allow SSH connections. This step is crucial for remote access, especially if you’re operating in a protected network environment.
$ sudo ufw allow ssh $ sudo ufw enable
This command configures UFW to allow inbound SSH connections, ensuring that remote attempts to connect to the server via SSH are not blocked by the firewall. Connect to Your Ubuntu Machine via SSH: With SSH enabled and the firewall configured, you can now connect to your Ubuntu machine from another computer using SSH.
$ ssh username@your_server_ip_OR_hostname
Replace username with your actual username on the Ubuntu system, and your_server_ip with the IP address of your Ubuntu machine. This allows for secure remote access to your system.
