Jump to content
em

Recuperare parola uitata linux

Recommended Posts

Posted

Sa spunem ca ai o partitie de linux pe care o folosesti din an in paste si nu iti mai stii parola la user. Recuperatu parolei este extrem de simpla daca folosesti grub.

Cand iti apare grub-ul la boot te pozitionezi pe intrarea cu linux si apesi 'e'.

grub.jpg

Iti va aparea un editor de text minimal in care poti modifica toti parametrii de boot.

grub-single-user-mode-select-kernel-763178.png

Tot ce trebuie sa faceti este sa editati linia selectata.

De exemplu linia de mai sus


kernel /boot/vmlinuz-2-6-15-1-686 root=/dev/sda1 ro

trebuie modificata in


kernel /boot/vmlinuz-2-6-15-1-686 root=/dev/sda1 rw init=/bin/bash

Sau daca linia ar arata asa


linux /boot/vmlinuz-3.6.0-2-486 root=UUID ro

ar trebui modificata asa


linux /boot/vmlinuz-3.6.0-2-486 root=UUID rw quiet init=/bin/bash

Ce fac modificarile? Montezi disk-ul readwrite (era montat ro - readonly). Si fortezi ca primul proces deschis de sistem sa fie bash (nu init) - evident acesta va fi deschis ca root.

Apasa F10 sa bootezi dupa ce ai modificat.


em-hax # ps -e |head -3
PID TTY TIME CMD
1 ? 00:00:03 bash
2 ? 00:00:00 kthreadd
3 ? 00:00:01 ksoftirqd/0

Acum tot ce mai e de facut e de schimbat parola la root.


em-hax # passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Cum va puteti proteja de acest atac? :-) Parola pe grub.


$ cat /etc/grub.conf
default=0
timeout=15
password paxeratat

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...