Enable SSH for Ubuntu
✅ Step 1: Install the SSH Server
Open a terminal (locally or via console) and run:
sudo apt update
sudo apt install openssh-server -y
✅ Step 2: Enable and Start the SSH Service
sudo systemctl enable ssh
sudo systemctl start ssh
✅ Step 3: Check SSH Status
Verify that SSH is running:
sudo systemctl status ssh
You should see something like: Active: active (running)
Enable ROOT
✅ Step 1: Set a Password for Root
sudo passwd root
•You'll be prompted to enter and confirm a new password for the root user.
•After this, the root account will be enabled.
✅ Step 2: Allow Root Login Over SSH
By default, SSH might block root login. To allow it:
1.Open the SSH config file:
sudo nano /etc/ssh/sshd_config
2.Find the line:
PermitRootLogin prohibit-password
3.Change it to:
PermitRootLogin yes
4.Save and exit (Ctrl+O, Enter, Ctrl+X).
5.Reload SSH:
sudo systemctl restart ssh