Author Topic: How to enter CentOS without username&password  (Read 4908 times)

0 Members and 1 Guest are viewing this topic.

Offline WYSIATI

  • /dev/null
  • *
  • Posts: 8
  • Cookies: -1
    • View Profile
How to enter CentOS without username&password
« on: March 29, 2013, 01:14:19 pm »
Hi, guys. My tutor just gave me a server, which had been installed CentOS. He told me to learn Linux with it, but first of all, I should enter it and back up data without username and password!!! Cuz he forgot all of them....... Now I am running this noisy server, there are only 4 items I can choose: Language, Session, Restart or Shut Down. Also, a field to enter user's info.  Could you please tell me how to do? THANK YOU!!!
(The first thing I wanna do is to backup all data on this server)
« Last Edit: March 29, 2013, 01:37:44 pm by WYSIATI »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: How to enter CentOS without username&password
« Reply #1 on: March 29, 2013, 02:59:56 pm »
Since you have physical access to the server, maybe boot up a liveUSB distro, grab a passwd file and crack it with JtR (John the Ripper)?

Offline Snayler

  • Baron
  • ****
  • Posts: 812
  • Cookies: 135
    • View Profile
Re: How to enter CentOS without username&password
« Reply #2 on: March 29, 2013, 03:19:51 pm »
Since you have physical access to the server, maybe boot up a liveUSB distro, grab a passwd file and crack it with JtR (John the Ripper)?
It would be easier to just boot a LiveCD/USB, mount the server's drive and backup everything.

Offline s3my0n

  • Knight
  • **
  • Posts: 276
  • Cookies: 58
    • View Profile
    • ::1
Re: How to enter CentOS without username&password
« Reply #3 on: March 29, 2013, 04:06:51 pm »
I think instead of mounting the hdd and copying the root password hash from the shadow file and cracking it, just blank out the root hash in the shadow file, write the changes, reboot into the hdd and login with a blank root password. Then put the hash back into the shadow file (after maybe creating a new admin user for your self [sudo or something maybe] ) .
Easter egg in all *nix systems: E(){ E|E& };E

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: How to enter CentOS without username&password
« Reply #4 on: March 29, 2013, 05:04:52 pm »
init=/bin/bash

Append that ^ to your grub entry.
Then remount the / as with r+w .
Either remove the root user's password from shadow as mentioned or add a user with same privs and work from there.
Pretty doable.
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline WYSIATI

  • /dev/null
  • *
  • Posts: 8
  • Cookies: -1
    • View Profile
Re: How to enter CentOS without username&password
« Reply #5 on: March 30, 2013, 03:30:24 am »
init=/bin/bash

Append that ^ to your grub entry.
Then remount the / as with r+w .
Either remove the root user's password from shadow as mentioned or add a user with same privs and work from there.
Pretty doable.
I think instead of mounting the hdd and copying the root password hash from the shadow file and cracking it, just blank out the root hash in the shadow file, write the changes, reboot into the hdd and login with a blank root password. Then put the hash back into the shadow file (after maybe creating a new admin user for your self [sudo or something maybe] ) .
It would be easier to just boot a LiveCD/USB, mount the server's drive and backup everything.

THANK YOU!!!!
I found it was not so complicated. I entered single user mode, and changed the root's pwd, done. Now I am mounting an external hard drive, when I typed [yum search fuse] or [yum install fuse] on terminal, I only got [Loaded plugins fastestmirror    Loading mirror speeds from cached hostfile]. I am search for solution.
« Last Edit: March 30, 2013, 03:31:15 am by WYSIATI »