[Tutorial] Cum resetez parola de root?

Parola de root de pe un linux, e destul de importantă, È™i dacă o uităm, e destul de complicat să trăim fără ea. Nu de alta, dar mai trebuie adăugaÈ›i useri, făcute update’uri si alte ghiduÈ™ii specifice.

Cel mai simplu mod de a reseta o parolă de root, È™i care de obicei funcÈ›ionează 99% este cu un Live CD (Ubuntu È™i Knoppix, sunt două distribuÈ›ii care oferă astfel de LiveCD’uri). Se bagă discul în unitatea optică, se boot-ează de pe disc, se montează partiÈ›ia pe care sălășluieÈ™te folderul /etc de pe sitemul linux căruia vrei să îi resetezi parola È™i suntem aproape de adevăr. Căutăm aici fiÈ™ierul shadow

/etc/shadow

unde vom găsi mai multe linii de text. Linia care ne interesează pe noi ar trebui să fie prima, și arată ceva de genul:

root:$1$MEoQ7QU.S/5yQx0zDFANFZflNL3vN/:13291:0:99999:5:::

Bucata de text cu roșu este parola userului root, criptată. Important de ținut minte este că e incadrată de cate două puncte in ambele părți. E destul să stergi partea cu roșu, salvezi fișierul, rezultatul o să fie similar cu:

root::13291:0:99999:5:::

Acum poți să restartezi, scoți discul din unitatea optică înainte de boot, pornește sistemul, et voila, userul root nu mai are parola setată.

La promptul de login introduci “root”, iar când sistemul cere parola, un simplu enter ajunge. Simplu, nu?

După ce te-ai logat, tastează comanda passwd ca să ai totuși o parola de root setată.

Evident există si alte metode, cum ar fi “single user boot” dar despre asta într-un post viitor.

Geek joke

A c-string walks into a bar. It says to the bartender,
“Can I have a beer and some fadsh543%$%lkjfdslfj/bin/sh”.
The bartender turns and says:
Welcome root, You’ve got mail

Via Bibi, care a auzit-o de la Eti. Bibi, ai inteles-o?

Later Edit:

Si cum tocmai a aparut o simpatica vulnerabilitate de dd-wrt, si eu am dd-wrt acasa, am reusit sa il sparg…

Chestia se potriveste de minune cu gluma de mai sus din pacate…
marius-perijocs-macbook:ddwrt mariusperijoc$ nc 192.168.1.1 5555
id
uid=0(root) gid=0(root)
whoami
root
ps ax
BusyBox v1.11.1 (2008-07-27 16:09:08 CEST) multi-call binary

Usage: ps

ps
PID USER       VSZ STAT COMMAND
1 root      1172 S    /sbin/init noinitrd
2 root         0 SW   [keventd]
3 root         0 RWN  [ksoftirqd_CPU0]
4 root         0 SW   [kswapd]
5 root         0 SW   [bdflush]
6 root         0 SW   [kupdated]
10 root         0 SW   [mtdblockd]
14 root      1184 S    /sbin/watchdog
85 root      1164 S    resetbutton
129 root      1844 S    httpd -p 80
131 root       812 S    dnsmasq --conf-file=/tmp/dnsmasq.conf
230 root       700 S    cron
236 root      1532 S    dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_ho
260 root      1164 S    process_monitor
380 root      1168 S    upnp -D -L br0 -W vlan1 -I 60 -A 180
482 root      1164 S    /sbin/wland
487 root      1168 S    ttraff
540 root         0 Z    [schedulerb.star]
544 root         0 Z    [wdswatchdog.sta]
759 root      1108 S    sh -c /tmp/exec.tmp>/tmp/shellout.asp
760 root      1104 S    /bin/sh /tmp/exec.tmp
762 root      1104 S    /bin/sh
768 root      1108 R    ps
^C
marius-perijocs-macbook:ddwrt mariusperijoc$

PS: L-am patchuit, deci nu va stresati, dar daca aveti prieteni cu dd-wrt’uri, anuntul oficial e undeva pe aici si fixul e aici.

Debian 5.0 Released

Via SlashDot, I found out that Debian 5.0 is out of the oven. They worked hard on it, and I’m downloading it as we speak, but the features seem to be many and if I know Debian they tested everything thoroughly and extensively. 

This is the slashdot article: 

The Debian Project is pleased to announce the official release of Debian GNU/Linux version 5.0 (codenamed Lenny) after 22 months of constant development. With 12 supported computer architectures, more than 23,000 packages built from over 12,000 source packages and 63 languages for the new graphical installer, this release sets new records, once again. Software available in 5.0 includes Linux 2.6.26, KDE 3.5.10, Gnome 2.22.2, X.Org 7.3, OpenOffice.org 2.4.1, GIMP 2.4.7, Iceweasel 3.0.6, Apache 2.2.9, Xen 3.2.1 and GCC 4.3.2. Other notable features are X autoconfiguring itself, full read-write support for NTFS, Java programs in the main repository and a single Blu-Ray disc installation media. You can get the ISOs via bittorrent. The Debian Project also wishes to announce that this release is dedicated to Thiemo Seufer, a Debian Developer who died on December 26th, 2008 in a tragic car accident. As a valuable member of the Debian Project, he will be sorely missed.

And of course the official announcement on the Debian homepage is here.

Have fun!

Windows Supports Linux!

It was about time this happened, and honestly, I’m going to personally write a letter of recommendation to everyone that wants to use Windows this way. The procedure is simple, I can offer free trainings on it, I will even come to your place, almost for free… 

Below you have a basic example, but the various situations you can take advantage of this situation are basically limitless… 

[Pictures from Ducu Epure]


 

big SALE!

Lume lumeeeeee, avem de vanzare niscaiva componente:

laptop fujitsu siemens amilo Pa1510 – 1200 RON neg
smartphone HTC 3600 impecabil – 900 RON neg (sau schimb cu un nokia + diferenta)
aparat foto canon S3 impecabil – 900 RON neg
router wireless linksys wrt54gl – 180 RON neg
switch repotec 16P – 80 RON neg
hands free tip colier cu 2 casti + magnet – 200 RON neg

Detalii mai jos (inclusiv contact)

laptop fujitsu siemens amilo Pa1510

Tehnologie AMD Mobile
Tip procesor Mobile AMD Turion 64 X2
Model procesor TL-50
Frecventa procesor 1600 MHz
Cache L2 2 x 256 KB
Diagonala 15.4 inch
Tip display WXGA TFT
Tehnologii BrilliantView
Rezolutie 1280 x 800 pixeli
Chipset video ATI Radeon Xpress 1100
Capacitate memorie video pana la 256 MB
Capacitate HDD 120 GB
Interfata SATA
Memorie RAM standard 1024 MB
Tip memorie RAM DDR2
Sloturi de memorie 2
Unitate optica DVD+/-RW
Difuzoare incorporate Da
Card reader 4-in-1 ( SD, MMC, MS, MSPRO )
Retea Ethernet 10/100
Wireless 802.11 b/g
Modem 56K V.92
Porturi 1 x IEEE 1394
1 x CRT
1 x Line-out
1 x Line-in
1 x DC-in
1 x RJ-11
1 x RJ-45
1 x S-Video
3 x USB 2.0
Sloturi de extensie 1 x ExpressCard 34/54
Tehnologii Kensington Lock
Baterie Li-Ion, 6 celule
Autonomie pana la 2 ore

OBS: are schimbat in garantie display, ram, placa de baza, hard, practic este nou, provenienta emag.ro

smartphone HTC 3600 impecabil

Retele GSM 850 / GSM 900 / GSM 1800 / GSM 1900 / UMTS / HSDPA
Tip TFT LCD QVGA touch screen, 65K color
Rezolutie 240 x 320 pixels 2.8”
Recunoasterea scrisului de mana
Tip Polyphonic (40 channels)
Vibratii Da
Agenda Nelimitata
Registru apel Da
Memorie 64 MB RAM, 128 MB ROM
Procesor Samsung® SC32442A 400 MHz
Slot Card mini SD
GPRS Class B / Multi-slot standard Class 10
GPS Da HSCSD EDGE Class 10, 236,8 kbps
3G Da, 384 kbps
WLAN Wi-Fi 802.11b/g
Bluetooth Da, v2.0
Port infrarosu Da, SIR
USB Da, mini USB
OS Microsoft WindowsTM Mobile 6.1 PDA Phone Edition
Mesagerie SMS, MMS, Push E-Mail, MSN Messenger
Jocuri Da
Ceas Da
Alarma Da
Culoare Alb
Camera 2,0 MP, 1600 x 1200 pixelii, VGA – a doua camera pentru apeluri video
Tip Recincarcabila Li-Ion Capacite: 1500 mAh
Standby Pana la 250 h
Talk time Pana la 5 h

OBS: impecabil, Rom Karmba_a 8.0 EN-Windows 6.1 Build 19588-TouchFLO Full Programs & New Skin WINDOWS MOBILE 7

aparat foto canon S3 impecabil

Tip senzor CCD
Dimensiune senzor 1/2.5″
Rezolutie 6 MP
Tip procesor de imagine DIGIC II cu tehnologie iSAPS
Rezolutii de imagine (L)2816 X 2112, (M1) 2272 X 1704, (M2)1600 x 1200, (S)640 x 480, (W)2816 x 1584
Clipuri video (L)640 x 480, 30/15fps (M)320 x 240, 60/30/15fps
Display Vari-angle P-Si TFT 2.0″, 115000 pixeli
Vizor electronic 0.33″, 115000 pixeli
Zoom optic 12x
Zoom digital 4x
Viteza obturator 15 – 1/3200 sec
Tip focalizare TTL auto / manuala
Distanta focala 6.0 – 72 mm
Stabilizator imagine Da (Shift-type)
Sensibilitate ISO Auto, High ISO Auto, 80, 100, 200, 400, 800
Moduri de balans de alb Auto, Insorit, Innorat, Tungsten, Fluorescent, Fluorescent H, Custom
Incorporat Da – Automat, Blitz fortat, Reducere ochi rosii, Sincronizare lenta, Fara blitz
Raza de actiune Panoramic: 50 cm – 5.2 m, Tele: 90 cm – 4 m
Conectare blitz extern Compatibil cu HF-DC1
Multishot max. 2.3 fotografii pe sec.
Autodeclansator 10, 2 sec
Efecte fotografice My Colors Off, Vivid, Neutru, Sepia, Alb negru, Positive Film, Lighter Skin Tone, Darker Skin Tone, Vivid Blue, Vivid Green, Vivid Red, Custom Color
Redare fisiere JPEG, AVI
Functii Ultrasonic Motor, Bracketing focus, Sound Memo, Senzor de orientare poza, Histograma, PictBridge, Compresie fisire (Superfine, Fine, Normal), Control expunere, Macro
Tip memorie suportata SD / MMC
Tip acumulator 4 x AA
Porturi USB 2.0 Hi-Speed,
AV Out
Sisteme video NTSC, PAL
Sisteme de operare compatibile Microsoft Windows 98SE/2000/ME/XP, Mac OS X v10.2 – 10.4

OBS: impecabil, provenienta SUA amazon.com

router wireless linksys wrt54gl VANDUT

Wireless Access Point Router w/ 4-Port Switch 802.11g and Linux,
Specificatii: Porturi:
1 x Wireless Access Point
1 x RJ-45 WAN
4 x RJ-45 10/100 Full Duplex
Securitate:
Criptare TKIP
Wireless MAC address filtering
Criptare AES
SPI Firewall
Standarde:
IEEE 802.11g
IEEE 802.11b

OBS: impecabil, firmware schimbat, provenienta emag.ro

switch repotec 16P

Model:RP-SW16P
Nr. porturi 16 RJ-45 ports for 100BASE-TX and 10BASE-T connectivityTransfer
Supports NWay protocol for speed (10/100Mbps) and duplex mode (Half/Full) auto-detection
Alte facilitati
Complies with 10BASE-T specifications of the IEEE802.3 standard
Complies with 100BASE-TX specifications of the IEEE802.3u standard
Supports back-pressure (half duplex) and flow control (IEEE 802.3x)

OBS:impecabil

hands free tip colier cu 2 casti + magnet

OBS: ideal in sesiune

pentru informatii gasiti omul pe yahoo messenger: gociucatalin sau la tel 0763612433

[Plesk] upgrade / autoinstaller

I was upgrading a plesk install today (linux based), using the plesk CP (Server / Updater) and I don’t like looking at an interface that says “You will receive an e-mail once the install is complete”.

A very simple solution for people that “need” to know what’s happening and don’t like waiting for an e-mail, is to log in the server using ssh (you can use PuTTY for that) go to /tmp:

cd /tmp

and do a:

ls -asl *log

You should see all the files ending in *log (beware, there might be quite a few files to match that pattern), and among them something like:

712 -rw——-  1 root root 724202 Aug  6 03:00 autoinstaller3.log

As soon as you locate that file, you can “tail” it. In my case:

tail -f autoinstaller3.log

Et voila, you will be able to see what’s happening with the upgrade process. To stop following the upgrade process, just pres Ctrl+C and you will get back to the bash prompt.

Servere custom, obiceiuri si obisnuiti

Sunt intr-o zi foarte ciudata, si am tendinta ca dupa fiecare chestie care mi se intampla, sa zic “urasc chestia care tocmai s-a intamplat” Si eu de obicei sunt un optimist.

Azi dupa-masa m-a sunat un numar pe care nu il aveam in agenda, dar dormeam. Am sunat inapoi, nimic. Urasc oamenii care te suna, nu poti sa le raspunzi si apoi, cand suni inapoi nu raspund nici ei…

Peste juma’ de ora ma suna el:

“Salut, sunt X, ne stim de acolo, bla bla bla, IT, bla bla bla, afacere online, cafeluta sa iti spun ce si cum…”

“E MLM?” (MLM – Multi Level Marketing, vezi pensiile private sau Amway)
“uhhh… Da…”
“Nu mersi, o seara faina!”

Am fost un pic mai on edge azi si ieri decat in rest, cu un proiect urgent si care trebuia terminat flawless din prima. Totul ar fi mers brici, daca unul din serverele cu care lucram nu era customizat waaaaay beyond any recognition, si am stat o ora si mi-am prins urechile, tremurand de nervi ca erau jos niste sisteme destul de importante si nu reuseam sa le pornesc. Pana la urma s-a rezolvat in 5 secunde de cel care a “customizat” serverul.

Unul din cele mai importante concepte, si guideline-uri din cadrul procesului de design al unui produs este acela de a nu schimba obiceiul utilizatorului. Adica, nu incerca sa obisnuiesti omul sa dea click pe mouse cu nasul, sau sa deschida usa cu genunchiul, sau sa ii muti X’ul ala din coltul dreapta sus al ferestrei in stanga jos. Aceeasi chestie se aplica si la mine. Daca tot ai customizat o chestie, scoate-o dracu pe aia default afara si nu ma mai enerva, macar sa stiu ce caut. In cazul de fata e vorba de un al doilea server de apache instalat din surse pe un server cand ala default s-a busit. Puteam sa ii dai restart cu service httpd sau din etc/init.d/ sau apachectl pana poimaine.

Daca tot schimbati ceva care de multe ori si entru multa lume vine de la sine inteles, faceti un pic de documentatie, si aveti grija sa nu o uitati pe stick, ci sa fie accesibila celui care va intra in contact cu schimbarea pe care ati facut-o.

Si nu am chef sa recitesc articolul, deci daca am greseli, va rog sa imi spuneti si le corectez mai incolo.

O seara faina.

[PLESK] removing/modifying open_basedir in plesk

Let’s think about a situation where you have a subdomain and you want it to be able to access files from the domain httpdocs directory. You cannot do that by default in Plesk, because of open_basedir. You can edit the httpd.include file in:

/var/www/vhosts/domain.com/conf/httpd.include

but that will only work until the next plesk restart or major modification.

But, the httpd.include file that manages a domain and subdomain explicitly says:

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /var/www/vhosts/domain.com/conf/vhost.conf
# /var/www/vhosts/domain.com/subdomains/subdomain-name/conf/vhost.conf

So, disabling open_basedir is *usually* as simple as editing the vhost.conf file (or create it if it does not exist), and adding:

Entire HOWTO here.