Wednesday, February 15, 2012

Disable root login in Ubuntu – Avoid unexpected ‘OMG’ problems.

Recently I faced a huge issues in my production environment ,where ppl try to login as root to system which made system more unstable(Yes I know its in mess- super democracy server). As you know Ubuntu came with ‘Sudo’ concept which gives all the privilege’s that you want in systems. There for don not allow root user in your system especially in production. More details can be found in :

 Two steps to block any root logins :
1.      Disable Root user : 
sudo passwd -dl root

2.  Disable root login in ssh config:
vim /etc/ssh/sshd_config
PermitRootLogin no
And restart sshd -- > /etc/init.d/sshd restart

BTWAY: I was able to recover lost root password from a linux machine. Will update on that in future release .

1 comment:

  1. Add User without home directory but with user priviladges and add default bash

    sudo useradd xxx
    sudo passwd xxx
    sudo usermod -aG sudo xxx
    sudo chsh -s /bin/bash xxx