Skip to content

Somik's Home

Server admins cheat codes

Menu
  • Bash
  • PHP
  • Arduino/ESP
  • About
    • eBook Reader
    • Codebin
    • User Management
    • Online Ruler
    • ShortURL Generator (Newer)
    • Video Downloader
    • ShortURL Generator (Older)
    • File Sharing
    • WhoIs Search
Menu

Ubuntu enable SSH for root user

Posted on 2019-10-082019-10-08 by somik

This is a very bad idea for servers on open internet. Only recommended for servers on local network that are behind firewall and SSH is not accessible from internet. To be used for testing only.

First install openssh server if not installed along with nano editor

sudo nano apt update
sudo nano apt upgrade
sudo apt install openssh-server nano

Change or set root user password

sudo passwd

Edit the ssh config file:

sudo nano /etc/ssh/sshd_config

Find the line that says:

#PermitRootLogin prohibit-password

And change it to:

PermitRootLogin yes

Save and exit using Ctrl+x followed by Y and then press Enter

Finally enable SSH during boot and restart it:

systemctl enable ssh
systemctl restart ssh

You can check the IP address of the server by running the command:

ip addr
May 2022
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Jul    

Archives

  • July 2021
  • February 2021
  • September 2020
  • August 2020
  • July 2020
  • May 2020
  • March 2020
  • November 2019
  • October 2019

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2022 Somik's Home | Powered by Minimalist Blog WordPress Theme