OVH Community, your new community space.

f%&$!! (I turned off root login on my debian server)


yonatan
30-12-2009, 01:43
same can be done from rescue-pro

boot from rescue ,
run this one line
don't forget the password you enter

for hardraid or kimsufi or RPS:
Code:
mkdir /mnt/sda1 ; mount /dev/sda1 ; chroot /mnt/sda1 ; echo "temp:x:0:0:temp,,,::/home/temp:/bin/bash" >> /etc/passwd ;passwd temp
for soft raid level1
Code:
mkdir /mnt/md1 ; mount /dev/md1 ; chroot /mnt/md1 ; echo "temp:x:0:0:temp,,,::/home/temp:/bin/bash" >> /etc/passwd ;passwd temp
enter a password.

reboot to normal netboot/hd

login with temp / password

fix your original root

after you done - and dont forget

userdel -r temp


good luck.

Paw-Fox
30-12-2009, 01:17
You should be able to, - not sure how you disabled root access.. but what you could try

Boot into vKVM and enable iso_boot and use a netboot cd to boot into a debian install.

when in the environment

Code:
mkdir /mnt/system
This is where we are going to mount your system

next,

Code:
mount /dev/sda(x) ((x depends on your hard drive.. etc.. use a program like "cfdisk" to find out where it was installed"
once you have mounted your filesystem,

Code:
chroot /mnt/system /bin/bash
this will then take you into your filesystem ready for editing, .. - I'm guessing somehow in /etc/passwd the root user has got disabled. maybe.. so

Code:
nano /etc/passwd
If there is a "#" in front of the root user like: "#root:x:0:0:root:/root:/bin/bash" - remove it,

If not.. it must be something else, - try creating a new user with root, for example:

Code:
adduser temp
now edit the /etc/passwd file as before, and change the uid so where you have
"temp:x:1000:1000:temp,,,::/home/temp:/bin/bash" replace them with "temp:x:0:0:temp,,,::/home/temp:/bin/bash"

and try rebooting and logging in as the temp user, that account should have root access.

Can you give more information what you were configuring in webmin that disabled root? - was it SSH?

If that doesn't help try reading this: http://www.debianadmin.com/forgot-ro...in-debian.html

Ashley
30-12-2009, 00:54
I turned off root login on my debian server using webmin.

Now I cant log into webmin as root, nor into ssh using another user and trying to use su.

Any ideas? It's if root as a whole has been disabled.

What about using vKVM and a net ISO?

I'm running out of ideas