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
January 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Sep    

Archives

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

Meta

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